Skip to content

alokmenghrajani/go-cryptopals

Repository files navigation

go-cryptopals

My solutions to the Cryptopals cryptography challenges 🔒 in well[citation needed] commented Golang.

A lot of things are implemented from scratch for lolz: hex, base64, AES with various modes (plain, ECB, CBC, CTR), SHA-1, SHA-256, MD4, HMAC-SHA1, HMAC-SHA256.

A branch implements bigints from scratch but is currently too slow to be used to solve all the challenges.

The references folder contains a copy of various whitepapers and RFCs useful for solving these challenges.

I have solved sets 1 through 7. I hope to finish the final set 8 soon 🤞.

Set 1

Set 2

Set 3

Set 4

Set 5

Set 6

Set 7

Set 8

  • Diffie-Hellman Revisited: Small Subgroup Confinement
  • Pollard's Method for Catching Kangaroos
  • Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks
  • Single-Coordinate Ladders and Insecure Twists
  • Duplicate-Signature Key Selection in ECDSA (and RSA)
  • Key-Recovery Attacks on ECDSA with Biased Nonces
  • Key-Recovery Attacks on GCM with Repeated Nonces
  • Key-Recovery Attacks on GCM with a Truncated MAC
  • Truncated-MAC GCM Revisited: Improving the Key-Recovery Attack via Ciphertext Length Extension
  • Exploiting Implementation Errors in Diffie-Hellman

Set 9

I found an unofficial set 9 by Andrei Ilchenko.