Text Encryption and Decryption
Cryptology Monster encrypts text using AES-256-GCM and supports both randomly generated keys and password-derived keys. AES-GCM provides confidentiality together with authentication of the encrypted data.
Encryption Modes
| Mode | Key Source | Required for Decryption |
|---|---|---|
| Random key | Generated AES-256 key | key.bin |
| Password | PBKDF2-derived AES-256 key | Original password |
Both modes download the encrypted text as:
encrypted.binEncrypting Text with a Random Key
Usage
- Select Encrypt.
- Enter plaintext.
- Leave Use password-based key (PBKDF2) unchecked.
- Click Encrypt and Download.
- Save both downloaded files.
Output
encrypted.bin
key.binThe application generates a random 256-bit AES key and a random 12-byte initialization vector (IV).
The AES key is exported as 32 raw bytes in key.bin.
Encrypted File Layout
[12-byte IV][AES-GCM ciphertext and authentication tag]The file does not contain a text header or filename metadata.
Decryption
- Select Decrypt.
- Upload
encrypted.bin. - Upload the corresponding
key.bin. - Leave password mode disabled.
- Click Decrypt.
- Read the resulting plaintext.
If the files do not correspond or the encrypted content has been modified, authentication should fail.
Encrypting Text with a Password
Usage
- Select Encrypt.
- Enter plaintext.
- Enable Use password-based key (PBKDF2).
- Enter a password.
- Click Encrypt and Download.
- Save
encrypted.bin.
Key Derivation
| Parameter | Value |
|---|---|
| Algorithm | PBKDF2 |
| Hash | SHA-256 |
| Iterations | 100,000 |
| Salt length | 16 bytes |
| AES key length | 256 bits |
| AES mode | GCM |
| IV length | 12 bytes |
The application generates a random salt and IV for every encryption operation.
Although the interface includes an optional salt field, the supplied encryption function always generates a new salt and does not read the manually entered value.
Encrypted File Layout
[16-byte salt][12-byte IV][AES-GCM ciphertext and authentication tag]The salt and IV are stored in the encrypted file.
They are not secret.
Decryption
- Select Decrypt.
- Upload
encrypted.bin. - Enable password-based mode.
- Enter the original password.
- Click Decrypt.
- Review the plaintext in the output area.
The program reads the salt and IV from the file and derives the same AES key from the supplied password.
Understanding Authentication
AES-GCM authenticates encrypted content.
Decryption generally fails when:
- The password is wrong.
- The key file is wrong.
- The encrypted content has changed.
- The file is truncated.
- The wrong encryption mode is selected.
This helps detect accidental corruption and unauthorized modification.
Important Security Warning
In password-based text encryption mode, the supplied implementation displays the entered password in plaintext in the Encryption Info result window.
Anyone who can see the result window can read that password.
Avoid exposing the result window, and treat this as a security limitation of the current implementation.
Text Handling
The plaintext is trimmed before encryption.
This means leading and trailing whitespace can be removed.
For example, the original text:
confidential message is processed as:
confidential messageThe application uses UTF-8 when encoding the plaintext.
Compatibility
The text encryption format is application-specific.
It does not automatically produce an OpenPGP message, ZIP archive, or standard encrypted document container.
To decrypt the generated file in another application, that application must understand the key-derivation parameters and binary layout.
Recovering Encrypted Text
| Encryption Mode | What to Preserve |
|---|---|
| Random key | encrypted.bin and key.bin |
| Password | encrypted.bin and the exact password |
There is no recovery mechanism shown in the source code.
Important: Before relying on encryption for important information, perform a complete encryption and decryption test and retain secure backups of required keys.
Updated 9 days ago
