A seed-driven “book cipher” that hides your message in a deterministic pseudo-random text stream. Instead of sending encrypted files, you share a short hex pointer plus an encrypted phrase. With the same seed, the recipient regenerates just the right block of text, forces in the phrase, and extracts it.
-
Agree on a seed
You and your correspondent pick a secret string (the seed). -
Generate text blocks
- Each block (default 1024 characters) is created by hashing
seed + block_index. - A pseudo-random generator uses that hash to produce the block on demand.
- Each block (default 1024 characters) is created by hashing
-
Map phrase to location
- Hash
phrase + seedto pick a block index and offset within it. - Compute a numeric location =
block_index * block_size + offset.
- Hash
-
Create an opaque pointer
- XOR that location with a 64-bit key derived from the seed hash.
- Encode the result in hex.
-
Encrypt the phrase
- XOR each byte of your phrase with a repeating key from
SHA-256(seed). - Convert to hex and append after the pointer, separated by
:.
- XOR each byte of your phrase with a repeating key from
-
Retrieve the message
- Split the pointer and encrypted phrase by
:. - Reverse the XOR on the location to get
block_indexandoffset. - Regenerate that block, overwrite it with the decrypted phrase, and extract your message.
- Split the pointer and encrypted phrase by
Use the provided scripts to install Python and Tkinter dependencies.
./install.sh # install dependencies
./install.sh --dry-run # show commands without executingRun the PowerShell script:
.\install.ps1
# or
.\install.ps1 -DryRun # show commands without executingRun the simple Tkinter GUI to search for a phrase or decode a pointer:
python gui.pyRequirements
Python 3.7 or later
Uses only standard library modules (hashlib, random, etc.)
License
All rights reserved. See LICENSE.