Encrypted Message Crypté is a small application that allows you to share passwords, secret messages, or private links securely with another person. It does this by hiding your message behind a unique URL that can only be viewed once. Messages automatically expire after a predefined time limit if they are not viewed.
Below is a short animated GIF showing the application in action.
The application uses a combination of AES-256 encryption and a unique URL to hide your message. When you enter a message, the application generates a unique URL that contains a reference ID to decrypt your message. You can then share this URL with the intended recipient. When the recipient opens the URL, the application will decrypt the message and display it to them once they click the "View secret" button (this avoids accidental views through URL unfurling). The message is then deleted from the database and can no longer be viewed.
Optionally, you can also encrypt the message on the client side before sending it to the server. This means that the server never sees the unencrypted message. This is useful if you don't trust the server or if you want to add an extra layer of security. However, the recipient will need to know the password you used to encrypt the message in order to decrypt it.
Password-protected messages use a versioned emc:v2 envelope. The browser derives an encryption key with PBKDF2-HMAC-SHA-256 and encrypts the message with AES-256-GCM through the Web Crypto API. The password and derived key never leave the browser. Each new record also stores a non-secret marker indicating whether browser encryption was selected, so the password controls only appear when they are needed. CryptoJS AES-CBC links are no longer supported.
The application allows you to specify both an encryption backend as well as a storage backend. This allows you to run the application across multiple cloud service providers or even on your own hardware. The interfaces for the encryption and storage backends are defined in the encryption/encryption_backend.go and storage/storage_backend.go files respectively.
The application comes with two encryption backends out of the box:
encryption/rsa.go- This backend uses RSA encryption to encrypt the message. Please use themake generate-keyscommand before running the application to generate the necessary keys and not use the default ones.encryption/aws_kms.go- This backend uses the AWS Key Management Service (KMS) to encrypt the message.
The application also comes with two storage backends out of the box:
storage/dynamodb.go- This backend uses DynamoDB to store the encrypted message.storage/in_memory.go- This backend uses an in-memory map to store the encrypted message. This backend is useful for testing and will not persist data across restarts.
If you would like to build your own binaries with custom backends, take a look at the cmd/app and cmd/lambda_app directories for inspiration.
The standalone container does not include the committed demo private key. Mount a generated key directory read-only at /keys when starting it (make run does this), or set PUBLIC_KEY_PATH and PRIVATE_KEY_PATH to externally mounted files. Startup fails if either key is unavailable. The Lambda image uses AWS KMS and contains no RSA keys.
This project is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.
