Note that if a certain ID is invalid and reset, it may be that the ID is too short or occupied, please try a different ID.
δΈζζζ‘£: README_CN.md
This project aims to provide a custom ID generation function for RustDesk, making it easier for users to remember and manage devices. The primary function is to simulate the official encryption algorithm, encrypting user-entered custom IDs and outputting the encrypted ID. By replacing the enc_id field in the configuration file with this output, users can complete the setup.
For MacOS, the configuration file is located at:
~/Library/Preferences/com.carriez.RustDesk/RustDesk.toml
For Windows, the configuration file is located at:
C:\Users\username\AppData\Roaming\RustDesk\config\RustDesk.toml
When running in service mode in Windows, specified by --service :
C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml
- π Generate encrypted custom ID
- π Decrypt and validate encrypted ID
- π Use UUID as the encryption and decryption key
- π Automatic clipboard copy for encrypted/decrypted results
- π¬ Interactive mode for easy operation
- π Comprehensive help system
- π Multi-language support (English/Chinese)
- β¨οΈ Command-line interface with detailed parameter descriptions
The easiest way to get started is to download the pre-built binaries from our releases page:
Available platforms:
- Linux:
custom-rustdesk-linux-x86_64-gnu,custom-rustdesk-linux-aarch64-gnu - Linux (MUSL):
custom-rustdesk-linux-x86_64-musl,custom-rustdesk-linux-aarch64-musl - Windows:
custom-rustdesk-windows-x86_64.exe,custom-rustdesk-windows-aarch64.exe - macOS:
custom-rustdesk-macos-universal(supports both Intel and Apple Silicon)
- Download the appropriate binary for your platform
- Make it executable (Linux/macOS):
chmod +x custom-rustdesk-* - Run directly:
# Interactive mode ./custom-rustdesk-macos-universal # Command line mode ./custom-rustdesk-macos-universal --id 123456 --uuid your-uuid-here
If you prefer to build from source or need to modify the code:
- Rust (latest stable version)
- Git
-
Clone the repository:
git clone https://github.com/Jxpro/custom-rustdesk.git cd custom-rustdesk -
Build the project:
cargo build --release
-
Run the built binary:
# Interactive mode cargo run --release # Or run the built binary directly ./target/release/custom-rustdesk
For development purposes, you can run directly with cargo:
cargo runRun without parameters to enter interactive mode:
# Using pre-built binary
./custom-rustdesk-macos-universal
# Or from source
cargo runThe interactive menu provides:
- Encrypt Mode: Generate encrypted ID from custom ID
- Decrypt Mode: Verify and decrypt encrypted ID
- View Help: Display comprehensive help information
- Exit: Quit the application
The tool supports both command-line and interactive modes. For command-line usage:
# Using pre-built binary:
# Generate encrypted ID
./custom-rustdesk-macos-universal --id <CustomID> --uuid <MachineUUID>
# Verify encrypted ID
./custom-rustdesk-macos-universal --eid <EncryptedID> --uuid <MachineUUID>
# Set language (en/zh)
./custom-rustdesk-macos-universal --lang zh
# Show help
./custom-rustdesk-macos-universal --help
# From source:
# Generate encrypted ID
cargo run -- --id <CustomID> --uuid <MachineUUID>
# Verify encrypted ID
cargo run -- --eid <EncryptedID> --uuid <MachineUUID>
# Set language (en/zh)
cargo run -- --lang zh
# Show help
cargo run -- --help-i, --id <ID>: Custom ID to encrypt-e, --eid <EID>: Encrypted ID to decrypt-u, --uuid <UUID>: UUID for encryption/decryption-l, --lang <LANG>: Set the language (en/zh) [default: en]-h, --help: Show detailed help information
The tool supports both English and Chinese:
- Default language is English
- Use
--lang zhfor Chinese interface - Language setting affects all output including help text and error messages
This tool now supports automatic machine UUID detection! This is the simplest and most convenient way:
- Interactive Mode: The program will automatically detect and display the machine UUID when running, asking whether to use it
- Command Line Mode: When the
--uuidparameter is not provided, it automatically detects and confirms usage - Cross-Platform Support: Supports Windows, macOS, and Linux systems
- User Confirmation: After detecting the UUID, it will ask for user confirmation, pressing Enter defaults to "yes"
Usage examples:
# Automatic UUID detection (recommended method)
./custom-rustdesk-macos-universal --id 123456
# The program will automatically detect UUID and ask for confirmation
# Interactive mode also supports automatic detection
./custom-rustdesk-macos-universalIf you need to manually obtain or verify UUID for configuring RustDesk on other devices, please refer to the following methods:
You can also get more complete information through the official tool machine-uid
-
Windows:
- Open Terminal.
- Enter the following command:
(Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography).MachineGuid - Copy the
MachineGuidvalue as theuuidparameter.
-
MacOS:
- Open Terminal.
- Enter the following command:
ioreg -rd1 -c IOPlatformExpertDevice | grep IOPlatformUUID - Copy the UUID from the output as the
uuidparameter.
-
Linux:
- Open Terminal.
- Enter the following command:
cat /etc/machine-idorcat /var/lib/dbus/machine-id - Copy the machine ID from the output as the
uuidparameter.
- Download the pre-built binary or clone the code locally.
- Find the
enc_idfield in the respective configuration file. - Run the validation command:
# Using pre-built binary ./custom-rustdesk-macos-universal --eid $enc_id --uuid $uuid # Or from source cargo run -- --eid $enc_id --uuid $uuid
- The program will output the decrypted ID, compare it with the current ID to check consistency.
- Download the pre-built binary or clone the code locally
- Run the encryption command (no need to manually provide UUID):
# Using pre-built binary ./custom-rustdesk-macos-universal --id MyComputer # Or from source cargo run -- --id MyComputer
- The program will automatically detect UUID and ask for confirmation, press Enter or type
yto confirm - The program outputs the encrypted ID, copy and replace it in the
enc_idfield of the configuration file
If you need to use a specific UUID, you can specify it manually:
# Using pre-built binary
./custom-rustdesk-macos-universal --id MyComputer --uuid 12345678-1234-1234-1234-123456789012
# From source
cargo run -- --id MyComputer --uuid 12345678-1234-1234-1234-123456789012Automatic Detection Mode:
$ ./custom-rustdesk-macos-universal --id TestComputer
π€ Automatically detected machine UUID:
π± Detected UUID: 3C17252C-4A25-54AB-8A92-B88D3D6665AA
β
Use this UUID? (y/n): [Press Enter or type y]
"TestComputer" is encrypted to "00u33upzDoDQeMfJZ36o3owBtJ0Ip8qKr2dff8qsbAug=="
β
Copied to clipboard
π Please replace the id with the enc_id field in the config fileManual Specification Mode:
$ ./custom-rustdesk-macos-universal --id TestComputer --uuid 12345678-1234-1234-1234-123456789012
"TestComputer" is encrypted to "00M72xC5id8C/F+IsG6VOWs5MEV2xhPI/nBBo="
β
Copied to clipboard
π Please replace the id with the enc_id field in the config fileThis program uses the crypto::secretbox module in the sodiumoxide library for symmetric encryption. The encryption key comes from the provided UUID string.
- Convert the custom ID string into a byte array.
- Convert the UUID string into a byte array and adjust its size to match the key length requirement.
- Use the
sodiumoxide::crypto::secretboxmodule to create a key andnonce. - Choose encryption or decryption operation based on the
encryptparameter. - Use the
secretbox::sealorsecretbox::openfunction for encryption or decryption. - Convert the encrypted byte array to a
base64encoded string and output it to the console.
You are welcome to contribute to this project! You can participate in the following ways:
- Submit code patches or issue reports
- Provide feedback and suggestions
- Help promote the project
If you have any questions, feel free to discuss on github issue, or send an email to jxpro@qq.com to contact me.