Cryptek

Secure file encryption for the command line

Version 0.26.3 • Checksums

$ ls -lh
-rw-r--r-- hector staff 516K vacation.jpg
-rw-r--r-- hector staff 17K secret.pdf
$ cryptek hash secret.pdf
SHA256(secret.pdf) = c4a59a578aee1d839c419291a08b9a15e1132d936e41c78be54688308601c710
$ cryptek stego hide secret.pdf --carrier vacation.jpg -s
Enter password:
Confirm password:
✓ Hid secret.pdf in vacation-stego.jpg [argon2id, scheme=f5]
WARNING: Keep this file intact — resaving, resizing, or recompressing it destroys the hidden data.
$ rm secret.pdf
$ ls -lh
-rw-r--r-- hector staff 516K vacation.jpg
-rw------- hector staff 491K vacation-stego.jpg
$ cryptek stego extract vacation-stego.jpg -s
Enter password:
✓ Recovered secret.pdf
$ cryptek hash secret.pdf
SHA256(secret.pdf) = c4a59a578aee1d839c419291a08b9a15e1132d936e41c78be54688308601c710
$

Security Features

AES-256-GCM

Industry-standard authenticated encryption providing both confidentiality and integrity.

Argon2id

Memory-hard key derivation that resists GPU and ASIC attacks. 64MB memory, 2 iterations.

Encrypted Headers

All metadata hidden inside encrypted blocks. Files appear as pure random data.

Anti-Fingerprinting

Variable header sizes (64-512 bytes) prevent file type identification.

Filename Hiding

Original filename stored in encrypted header. Optional random output names.

Secure Deletion

Overwrite files before removal. HDD: 3-pass, SSD: re-encrypt then delete.

RAM Decryption

Decrypt to RAM filesystem — data never touches disk storage. Linux and macOS.

Folder Encryption

Encrypt entire directories as tar archives with optional gzip compression.

Keyfile Support

Generate a 256-bit keyfile and use it alone — or combined with a password so both are required to decrypt.

String Encryption

Encrypt text snippets straight from the terminal. Base64 or hex output for secrets, notes, and config values.

Stealth Mode

Random output filename plus hidden file attribute. The real name travels inside the encrypted header.

Downgrade Protection

Key derivation parameters are validated against strict minimums — a tampered file cannot force weak KDF settings.

Steganography

Hide an encrypted file inside an ordinary-looking PNG, JPEG, BMP, TIFF, or WAV — pixel and audio-sample LSBs, or JPEG DCT coefficients with selectable schemes. Carrier metadata preserved. Concealment against casual inspection, not confidentiality.

Pixel-Cipher Visualizer

Educational: encipher only an image’s pixels so the result stays viewable — and you see the cipher work. AES-ECB leaks the picture (the “ECB penguin”), CTR/CBC/ChaCha20 turn it into noise. Works on PNG, uncompressed BMP and TIFF, and on baseline JPEG — which has no pixel domain at all, so it is enciphered in its DCT coefficients instead. The output always keeps the input’s format. BMP and TIFF recover byte-for-byte; a recovered JPEG is identical in every coefficient while ~98% of its bytes differ, because the entropy stream is re-serialised. Not a way to secure an image; every run says so.

Sample-Cipher Visualizer

The same idea for audio — and this one you hear. Encipher only a WAV’s PCM samples and it stays a playable file of the same duration. Digital silence is a run of identical samples, so AES-ECB maps it to identical ciphertext blocks: a periodic waveform you hear as a steady buzz wherever the original was quiet, while CTR, CBC and ChaCha20 give uniform noise. The metrics say it plainly — on the demo voiceover ECB reads entropy 7.85, which looks random, yet keeps the original’s duplicate-block rate of 19.7% exactly; shuffle leaves entropy identical to the original, because scrambling position is not encryption. Recovery is byte-for-byte exact. Not a way to secure audio, and re-encoding to MP3 or AAC destroys the ciphertext. Turn your volume down first.

Installation

One-Line Install

Automatically detects your OS and architecture.

curl -sSL https://hperez.dev/cryptek/install.sh | bash

Review the script before running.

Manual Install

Download the archive above, then extract and move the binary.

tar -xzf cryptek_*.tar.gz
sudo mv cryptek /usr/local/bin/

Quick Start

$ cryptek encrypt secret.pdf -s
Enter password:
Confirm password:
✓ Encrypted secret.pdf to secret.ctk [argon2id]
$
$ cryptek decrypt secret.ctk -s
Enter password:
✓ Decrypted secret.ctk to secret.pdf
$
$ cryptek encrypt --folder tax-records --compress -s
Enter password:
Confirm password:
Creating tar archive from folder: tax-records
Archive created: 48213 bytes (compressed)
Encrypting archive...
✓ Encrypted folder to: tax-records.tar.gz.ctk [argon2id]
Original folder deleted
$
$ cryptek keygen mykey.key
✓ Generated 32-byte keyfile: mykey.key
Keep this file secure - it is required to decrypt your files.
 
$ cryptek encrypt document.docx -K mykey.key
✓ Encrypted document.docx to document.ctk [argon2id]
$
$ cryptek encrypt secret.pdf --stealth -s
Enter password:
Confirm password:
✓ Encrypted to .985b3031638c70ca081580c2592b32ae [argon2id] (stealth mode)
$
$ cryptek encrypt vault.txt -s -S
Enter password:
Confirm password:
✓ Encrypted vault.txt to vault.ctk [argon2id] (securely deleted)
$
$ cryptek hash vault.txt
SHA256(vault.txt) = d80ff1ee8c6540ed3ca9873e3effda6706cc0b1b5515b448dfe25c2f479af230
$
$ cryptek stego hide secret.pdf --carrier photo.jpg -s
Enter password:
Confirm password:
✓ Hid secret.pdf in photo-stego.jpg [argon2id, scheme=f5]
WARNING: Keep this file intact — resaving, resizing, or recompressing it destroys the hidden data.
 
$ cryptek stego extract photo-stego.jpg -s
Enter password:
✓ Recovered secret.pdf
$
$ cryptek pixcompare cryptek-logo.png
WARNING: pixcipher is an EDUCATIONAL visualizer of cipher modes — NOT a way to secure an image. The image dimensions are visible, ECB leaks content, nothing is authenticated, and it includes deliberately broken options (xor, shuffle). To actually protect a file, use `cryptek encrypt`.
ALGORITHM ENTROPY(bits/byte) DUP-BLOCK RATE CLASS
(original) 2.891 88.0% plaintext
xor 7.083 87.0% toy
shuffle 2.891 0.0% toy
aes-ecb 6.636 88.0% block
aes-cbc 8.000 0.0% block
aes-ctr 8.000 0.0% stream
chacha20 8.000 0.0% stream
✓ Wrote the original + 6 enciphered images to cryptek-logo-pixcompare/
Higher duplicate-block rate = more structure leaked (watch aes-ecb vs aes-ctr).
$

Run cryptek --help for all commands and options.