Encryption Settings
Encryption algorithm to use for securing the connection.
Encryption key used to encrypt/decrypt traffic. Must be identical on both client and server.
Supported Encryption Algorithms
paqet supports the following encryption algorithms via theblock parameter:
AES Variants (Recommended)
AES Variants (Recommended)
aes: AES encryption (default, recommended)aes-128: AES-128 bit encryptionaes-128-gcm: AES-128-GCM authenticated encryptionaes-192: AES-192 bit encryption
Other Ciphers
Other Ciphers
salsa20: Salsa20 stream cipher (fast, good for embedded systems)blowfish: Blowfish block ciphertwofish: Twofish block ciphercast5: CAST5 block cipher3des: Triple DES (legacy, not recommended)tea: Tiny Encryption Algorithmxtea: Extended TEAsm4: Chinese national standard cipher
Weak or No Encryption
Weak or No Encryption
xor: Simple XOR cipher (weak, not recommended)none: No encryptionnull: No encryption
Generating Encryption Keys
Use thepaqet secret command to generate a secure random key:
The same key must be used in both the client and server configuration files for them to communicate.
Configuration Example
Using AES Encryption (Recommended)
Using AES-GCM for Authenticated Encryption
Using Salsa20 for Performance
Testing Without Encryption (Not Recommended)
Key Requirements
The encryption key can be any string, but longer keys are more secure. A minimum of 16 characters is recommended.
The encryption key must be identical on both client and server. Any mismatch will prevent connection establishment.
- Generate keys using
paqet secretfor cryptographic randomness - Never commit keys to version control
- Rotate keys periodically for enhanced security
- Use different keys for different deployments
Security Recommendations
Use Strong Encryption
Always use
aes, aes-128-gcm, or salsa20 for production deployments.Generate Random Keys
Use
paqet secret to generate cryptographically secure random keys.Protect Your Keys
Store configuration files securely and restrict file permissions.
Rotate Keys
Periodically change encryption keys for enhanced security.
Troubleshooting
Connection Fails with Encryption Enabled
Connection Fails with Encryption Enabled
Verify that:
- The
blockparameter is identical on client and server - The
keyparameter is identical on client and server - There are no extra spaces or special characters in the key
- The encryption algorithm is supported (check spelling)
Validation Error: 'KCP encryption key is required'
Validation Error: 'KCP encryption key is required'
You must provide a key when using any encryption algorithm except
none or null:Performance Issues with Encryption
Performance Issues with Encryption
If encryption is causing performance bottlenecks:
- Try
salsa20for faster encryption with good security - Use
aes(hardware-accelerated on most modern CPUs) - Avoid
3desandblowfish(slower legacy algorithms)