Miscellaneous Cryptography
cryptointermediate
Index of miscellaneous crypto pages - XOR and PRNG attacks.
cryptomiscxorprngindex
Miscellaneous Cryptography
This section covers crypto techniques that don't fit neatly into classical or modern categories - XOR-based ciphers and pseudo-random number generator weaknesses.
Pages in This Subsection
| Page | Difficulty | Key Technique |
|---|---|---|
| XOR Cryptography | Beginner | Single-byte, multi-byte, known-plaintext |
| PRNG Attacks | Advanced | MT19937 cloning, LCG cracking |
When to use each technique
XOR
- Single-byte key: brute all 256 values; score plaintexts with English letter frequency.
- Repeating key: normalized Hamming distance → guess key length → solve each position as single-byte XOR.
- Known plaintext (e.g.
flag{): XOR known bytes with ciphertext to recover key bytes.
PRNG
- Python
random(MT19937): 624 consecutive 32-bit outputs recover state - tools likerandcrack. - Java
Random: often brute-forceable when only part of the output is hidden. - Time-based seed: try Unix timestamps in a plausible window.
- Linear congruential generator (LCG): enough outputs to solve for multipliers and modulus (, , ).
Last updated on