Skip to content

Instantly share code, notes, and snippets.

@technion
Last active October 21, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technion/73ddbb5e339c42e95788f98f527b61f6 to your computer and use it in GitHub Desktop.
Save technion/73ddbb5e339c42e95788f98f527b61f6 to your computer and use it in GitHub Desktop.
Crypto cheat sheet

Weaknesses

ECB mode - unauthenticated Cut and paste blocks Chosen plaintext - use length controlled input for byte at a time decryption

CBC mode - unauthenticated Bitflipping attack to alter message CBC padding oracle decryption

CTR mode Random read/write - set text to find XOR with plaintext Bitflipping

CBC with IV=key Use XOR formula to recover key when in control of message

keyed SHA-1 Length extension attack

Timing attacks on hashes

Diffie Hellman Malicious g values

SRP Break with zero key vulnerable to dictionary attacks

RSA e=3 broadcast attack with CRT Bleichenbacher's e=3, maths regarding padding RSA Padding Oracle

DSA Key recovery from known nonce Key recovery from repeated nonce

Descriptions

NT Hash MD4(UTF-16LE(pass))

NTLMv2 protocol

SC = 8-byte server challenge, random CC = 8-byte client challenge, random CC* = (X, time, CC2, domain name) v2-Hash = HMAC-MD5(NT-Hash, user name, domain name) LMv2 = HMAC-MD5(v2-Hash, SC, CC) NTv2 = HMAC-MD5(v2-Hash, SC, CC*) response = LMv2 | CC | NTv2 | CC

HMAC(K,m) = H((K' ^ opad) || H((K' ^ ipad) || M))

HMAC-KDF PRK = HMAC(source, salt) K(1) = HMAC(PRK, context info || 0) K(i+1) = HMAC(PRK, K(i) || context info || i)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment