Back to Skills

symmetric-cipher-attacks

Symmetric cipher attack playbook. Use when exploiting block cipher mode weaknesses (CBC padding oracle, ECB cut-and-paste, bit flipping), stream cipher key reuse, or meet-in-the-middle attacks.

1,311stars179forksUpdated 7/8/2026

Security Assessment

Low Risk(85/100)

Detected risks:

Secret Exposure([SKILL.md] secret =)
Security Score85/100

About symmetric-cipher-attacks

A playbook for attacking symmetric encryption in CTF and authorized testing, focused on exploiting block-cipher mode weaknesses and stream-cipher mistakes rather than breaking the underlying cipher. It begins with a quick selection table linking observable behavior to the likely weakness and attack: identical ciphertext blocks for identical plaintext point to ECB (cut-and-paste or byte-at-a-time), a distinguishable padding error points to a CBC padding oracle, malleable ciphertext without integrity checks points to CBC bit flipping, XOR/stream key reuse points to a two-time pad, predictable PRNG output points to LCG/LFSR state recovery, and double encryption points to meet-in-the-middle.

The CBC padding oracle section explains the P_i = D_K(C_i) XOR C_{i-1} relationship and gives a full byte-at-a-time decryption routine that manipulates the previous ciphertext block, including the false-positive check for the last byte, plus PadBuster usage. CBC bit flipping shows how flipping a byte in one ciphertext block flips the corresponding plaintext byte in the next while corrupting the current one, with a worked admin=0 to admin=1 example. ECB coverage includes duplicate-block detection, cut-and-paste block reordering to forge a privileged token, and byte-at-a-time decryption of an appended secret against an encryption oracle. Stream-cipher coverage starts with known-plaintext and key reuse (two-time pad) where XORing two ciphertexts cancels the key, and the selection table also flags LFSR/LCG state recovery and meet-in-the-middle against 2DES-style double encryption.

Use it to identify which mode weakness a target exhibits and to carry out the matching attack, often decrypting or forging data without the key. Related routing points to rsa-attack-techniques when the symmetric key is RSA-protected, hash-attack-techniques for HMAC/hash authentication, and lattice-crypto-attacks for LCG/LFSR recovery via lattices. An advanced BLOCK_CIPHER_ATTACKS.md companion is referenced for full attack scripts, a step-by-step byte-at-a-time ECB walkthrough, PadBuster and custom padding-oracle scripts, and LCG/LFSR recovery code.

FAQ

What weaknesses does this skill target?

Block-cipher mode weaknesses (CBC padding oracle, CBC bit flipping, ECB cut-and-paste and byte-at-a-time), stream-cipher key reuse, LFSR/LCG state recovery, and meet-in-the-middle against double encryption.

How do I tell whether a target uses ECB?

Identical plaintext blocks produce identical ciphertext blocks; sending repeated input such as many A bytes and looking for repeated ciphertext blocks reveals ECB.

What can a CBC padding oracle do?

If the server reveals whether PKCS#7 padding is valid, you can decrypt any block without the key by manipulating the previous ciphertext block, one byte at a time.

What is the two-time pad attack?

When a stream cipher or XOR key is reused, XORing the two ciphertexts cancels the key and yields m1 XOR m2, which can then be recovered with cribs.

Are there tools or deeper references included?

Yes. It mentions PadBuster for padding-oracle attacks and points to a BLOCK_CIPHER_ATTACKS.md companion with full scripts and a byte-at-a-time ECB walkthrough.

All Files

2 files
SKILL.md14.0 KB
View
BLOCK_CIPHER_ATTACKS.md10.5 KB
View

Install symmetric-cipher-attacks

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill