π Encrypt your sensitive data using modern cryptography and turn it into secure QR codes!
Transform your private information into unreadable encrypted data using the powerful ChaCha20-Poly1305 cipher, then encode it as a QR code for easy sharing and storage. ππ±
- π Military-grade encryption with ChaCha20-Poly1305
- ποΈ PBKDF2 key derivation for enhanced security
- π± QR code generation for easy data transfer
- π RESTful API with interactive documentation
- π³ Docker support for easy deployment
- β‘ FastAPI backend for high performance
For legacy "1.x" QR codes, check the v1.6.0 documentation. π
- π Input: Your secret message and encryption key
- π Derivation: PBKDF2 transforms your key into a 32-byte cryptographic key
- π Encryption: ChaCha20-Poly1305 encrypts your data with authenticated encryption
- π± QR Generation: Encrypted data becomes a scannable QR code
Plaintext + Key β PBKDF2 β ChaCha20-Poly1305 β QR Code
Visit the live demo in your browser! π
π‘ Note: This is a free instance that may sleep during inactivity. Please be patient! β³
# Pull and run the API server
docker run --rm -p 8000:8000 allisson/secure-qrcode
# Access the web interface
open http://localhost:8000That's it! Your secure QR code generator is now running locally. π
To set up the project for local development:
-
Clone the repository:
git clone https://github.com/allisson/secure-qrcode.git cd secure-qrcode -
Install dependencies and run the API server:
uv sync uv run uvicorn secure_qrcode.api:app --reload
This will start the API server locally, and it will automatically reload on code changes.
-
Access the web interface and API docs:
- Web Interface: http://localhost:8000
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Explore the interactive API docs:
- π Swagger UI: http://localhost:8000/docs
- π ReDoc: http://localhost:8000/redoc
curl --location 'http://localhost:8000/v1/encode' \
--header 'Content-Type: application/json' \
--data '{
"plaintext": "my super secret text",
"key": "my super secret key"
}' | jq -r '.content' | base64 --decode > secure_qrcode.png
# Your encrypted QR code is saved as secure_qrcode.png! πΌοΈFirst, scan your QR code to get the encrypted data (it looks like this):
{
"salt": "LC1bxUNUpMnt/mae1KDNiA==",
"iterations": 1200000,
"associated_data": "0WdPVTKSb/a6KjB3NgjFww==",
"nonce": "FgmmR8D1Su13HgUO",
"ciphertext": "4FIQ8LAlztzaToyElulDcPAReKGnOd2TFYiH1P9ZatIOuHN+"
}Then decrypt it:
curl --location 'http://localhost:8000/v1/decode' \
--header 'Content-Type: application/json' \
--data '{
"encrypted_data": {
"salt": "LC1bxUNUpMnt/mae1KDNiA==",
"iterations": 1200000,
"associated_data": "0WdPVTKSb/a6KjB3NgjFww==",
"nonce": "FgmmR8D1Su13HgUO",
"ciphertext": "4FIQ8LAlztzaToyElulDcPAReKGnOd2TFYiH1P9ZatIOuHN+"
},
"key": "my super secret key"
}' | jqResponse:
{
"decrypted_data": "my super secret text"
}The default PBKDF2 iterations (1,200,000) provide excellent security. For custom security levels:
# Run with custom iterations (example: 1,000,000)
docker run --rm -p 8000:8000 \
-e secure_qrcode_pbkdf2_iterations=1000000 \
allisson/secure-qrcodeπ‘ Tip: Higher iterations = better security but slower performance. Find your balance! βοΈ
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests. π οΈ
This project is licensed under the MIT License - see the LICENSE file for details. π
Made with β€οΈ for secure data sharing