Implementation: AES-256-CBC encryption for all API keys
How it works:
- All API keys are encrypted before being stored in the SQLite database
- Uses industry-standard AES-256-CBC encryption algorithm
- Each encryption includes a random initialization vector (IV)
- Keys are only decrypted when needed for API calls
- Encryption key derived from machine-specific identifier
Affected fields:
deepl_api_keyopenai_api_keychatgpt_api_key
Code location:
backend/utils/encryption.js- Encryption utilitybackend/models/Settings.js- Automatic encryption/decryption
Storage format: IV:EncryptedData (hex encoded)
Database level:
- API keys never stored in plain text
- SQLite database file protected by OS file permissions
- No API keys in logs or error messages
Application level:
- Keys only loaded into memory when needed
- Automatic garbage collection after use
- No keys in frontend state longer than necessary
Configuration: backend/.env
# Optional: Custom encryption key (recommended for production)
ENCRYPTION_KEY=your-256-bit-key-here
# Optional: Machine-specific identifier
MACHINE_ID=your-unique-machine-idBest practice: Use environment variables for additional security layer
Password fields:
- All API key inputs use
type="password" - Keys masked in UI
- Never displayed in console logs
HTTPS recommendation:
- For production deployment, always use HTTPS
- Prevents man-in-the-middle attacks
- Encrypts all data in transit
Test Connection Feature:
- Validates API keys before saving
- Prevents storing invalid credentials
- Shows success/failure feedback
- Available in both Translation and Settings tabs
Security benefits:
- Detects compromised keys early
- Prevents unnecessary API charges
- Validates before sensitive operations
-
Protect Your API Keys
- Never share your API keys
- Don't commit
.envfiles to version control - Rotate keys regularly
- Use different keys for different applications
-
Database Security
- Keep
backend/data/translator.dbsecure - Don't share database file
- Backup encrypted, not plain text
- Use OS-level file encryption if needed
- Keep
-
Network Security
- Use on trusted networks
- Consider VPN for public Wi-Fi
- Don't expose ports to public internet
- Use firewall rules
-
Access Control
- Keep your computer password-protected
- Lock screen when away
- Use full-disk encryption if available
- Limit user access to application directory
-
Encryption Key Management
# Generate secure encryption key node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" # Add to .env echo "ENCRYPTION_KEY=<your-key>" >> backend/.env
-
Production Deployment
- Use environment variables for all secrets
- Enable HTTPS with valid certificates
- Use reverse proxy (nginx/Apache)
- Implement rate limiting
- Add authentication if multi-user
-
Database Backups
# Backup database (still encrypted) cp backend/data/translator.db backups/translator_backup_$(date +%Y%m%d).db
-
Audit Logs
- Monitor API usage
- Check for unusual patterns
- Review failed authentication attempts
The application includes automated tests that run on startup:
β Encryption/Decryption
β Settings Encryption for API Keys
β Database Connection
β All tables properly created
Run tests manually:
# Via API
curl http://localhost:5000/api/health/test
# Results show encryption is working- Verify Encryption:
# Check database - should see encrypted data
sqlite3 backend/data/translator.db "SELECT value FROM settings WHERE key='deepl_api_key';"
# Output should be encrypted (not plain text)- Test API Key Protection:
- Save an API key in Settings
- Close and restart application
- Verify key still works (decrypted properly)
- Check database (should still be encrypted)
Before using in production:
- Generate custom
ENCRYPTION_KEY - Set
NODE_ENV=productionin.env - Enable HTTPS
- Set up firewall rules
- Use strong OS passwords
- Enable full-disk encryption
- Backup database securely
- Review API provider security docs
- Test API key rotation
- Monitor API usage logs
β Database Theft: Keys encrypted, useless without encryption key β Memory Dumps: Keys cleared after use β Network Sniffing: Use HTTPS in production β Unauthorized Access: OS-level file permissions β Key Leakage: Never in logs or console β Insider Threats: Encrypted at rest
This is client-side security for a personal use application:
- Not suitable for multi-tenant systems
- Not enterprise-grade secret management
- Encryption key stored locally
- Best effort protection for personal use
For enterprise deployment, consider:
- Hardware Security Modules (HSM)
- Centralized secret management (HashiCorp Vault, AWS Secrets Manager)
- Multi-factor authentication
- Role-based access control
- Audit logging
- Intrusion detection systems
- β AES-256-CBC encryption for API keys
- β Secure password input fields
- β Test connection before save
- β Automated security tests
- β No keys in error messages
- β Encrypted database storage
- Optional master password
- Key derivation function (PBKDF2)
- Encrypted exports
- Session timeout
- Audit logging
- 2FA for sensitive operations
If you discover a security vulnerability:
- DO NOT open a public issue
- Document the vulnerability
- Include steps to reproduce
- Describe potential impact
- Suggest a fix if possible
Remember: This is a personal-use application. Focus on protecting your own data first.
Last Updated: November 2025
Security Level: Personal Use - Client-Side Encryption
Compliance: Not certified for regulated industries