{"id":21674988,"url":"https://github.com/alokmenghrajani/go-cryptopals","last_synced_at":"2026-02-27T04:04:38.541Z","repository":{"id":37419377,"uuid":"492335985","full_name":"alokmenghrajani/go-cryptopals","owner":"alokmenghrajani","description":"Cryptopals in Golang","archived":false,"fork":false,"pushed_at":"2025-04-26T09:39:01.000Z","size":5592,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-03T17:56:22.454Z","etag":null,"topics":["cryptography","cryptopals","cryptopals-challenges","cryptopals-crypto-challenges","cryptopals-go","cryptopals-solutions","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alokmenghrajani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-14T22:16:42.000Z","updated_at":"2025-06-30T18:14:45.000Z","dependencies_parsed_at":"2024-06-21T16:50:12.703Z","dependency_job_id":"19aad67c-13ea-4d37-a760-1563833fe692","html_url":"https://github.com/alokmenghrajani/go-cryptopals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alokmenghrajani/go-cryptopals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alokmenghrajani%2Fgo-cryptopals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alokmenghrajani%2Fgo-cryptopals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alokmenghrajani%2Fgo-cryptopals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alokmenghrajani%2Fgo-cryptopals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alokmenghrajani","download_url":"https://codeload.github.com/alokmenghrajani/go-cryptopals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alokmenghrajani%2Fgo-cryptopals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271574431,"owners_count":24783319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","cryptopals","cryptopals-challenges","cryptopals-crypto-challenges","cryptopals-go","cryptopals-solutions","go","golang"],"created_at":"2024-11-25T13:50:32.564Z","updated_at":"2026-02-27T04:04:33.507Z","avatar_url":"https://github.com/alokmenghrajani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-cryptopals\nMy solutions to the [Cryptopals cryptography challenges](https://cryptopals.com/) 🔒 in well\u003csup\u003e[\u003ci\u003e[citation needed]()\u003c/i\u003e]\u003c/sup\u003e commented Golang.\n\nA lot of things are implemented from scratch for lolz: [hex](encoding/hex), [base64](encoding/base64), [AES](http://www.moserware.com/assets/stick-figure-guide-to-advanced/aes_act_3_scene_02_agreement_576.png) with various [modes](cryptography/aes) (plain, ECB, CBC, CTR), [SHA-1](cryptography/sha1), [SHA-256](cryptography/sha256), [MD4](cryptography/md4), [HMAC-SHA1](cryptography/hmacSha1), [HMAC-SHA256](cryptography/hmacSha256).\n\nA [branch](https://github.com/alokmenghrajani/go-cryptopals/tree/bigint) implements bigints from\nscratch but is currently too slow to be used to solve all the challenges.\n\nThe [references](references/) folder contains a copy of various whitepapers and\nRFCs useful for solving these challenges.\n\nI have solved sets 1 through 7. I hope to finish the final set 8 soon 🤞.\n\n## Set 1\n- [Convert hex to base64](set1/challenge1.go)\n- [Fixed XOR](set1/challenge2.go)\n- [Single-byte XOR cipher](set1/challenge3.go)\n- [Detect single-character XOR](set1/challenge4.go)\n- [Implement repeating-key XOR](set1/challenge5.go)\n- [Break repeating-key XOR](set1/challenge6.go)\n- [AES in ECB mode](set1/challenge7.go)\n- [Detect AES in ECB mode](set1/challenge8.go)\n\n## Set 2\n- [Implement PKCS#7 padding](set2/challenge9.go)\n- [Implement CBC mode](set2/challenge10.go)\n- [An ECB/CBC detection oracle](set2/challenge11.go)\n- [Byte-at-a-time ECB decryption (Simple)](set2/challenge12.go)\n- [ECB cut-and-paste](set2/challenge13.go)\n- [Byte-at-a-time ECB decryption (Harder)](set2/challenge14.go)\n- [PKCS#7 padding validation](set2/challenge15.go)\n- [CBC bitflipping attacks](set2/challenge16.go)\n\n## Set 3\n- [The CBC padding oracle](set3/challenge17.go)\n- [Implement CTR, the stream cipher mode](set3/challenge18.go)\n- [Break fixed-nonce CTR mode using substitutions](set3/challenge19.go)\n- [Break fixed-nonce CTR statistically](set3/challenge20.go)\n- [Implement the MT19937 Mersenne Twister RNG](set3/challenge21.go)\n- [Crack an MT19937 seed](set3/challenge22.go)\n- [Clone an MT19937 RNG from its output](set3/challenge23.go)\n- [Create the MT19937 stream cipher and break it](set3/challenge24.go)\n\n## Set 4\n- [Break \"random access read/write\" AES CTR](set4/challenge25.go)\n- [CTR bitflipping](set4/challenge26.go)\n- [Recover the key from CBC with IV=Key](set4/challenge27.go)\n- [Implement a SHA-1 keyed MAC](set4/challenge28.go)\n- [Break a SHA-1 keyed MAC using length extension](set4/challenge29.go)\n- [Break an MD4 keyed MAC using length extension](set4/challenge30.go)\n- [Implement and break HMAC-SHA1 with an artificial timing leak](set4/challenge31.go)\n- [Break HMAC-SHA1 with a slightly less artificial timing leak](set4/challenge32.go)\n\n## Set 5\n- [Implement Diffie-Hellman](set5/challenge33.go)\n- [Implement a MITM key-fixing attack on Diffie-Hellman with parameter injection](set5/challenge34.go)\n- [Implement DH with negotiated groups, and break with malicious \"g\" parameters](set5/challenge35.go)\n- [Implement Secure Remote Password (SRP)](set5/challenge36.go)\n- [Break SRP with a zero key](set5/challenge37.go)\n- [Offline dictionary attack on simplified SRP](set5/challenge38.go)\n- [Implement RSA](set5/challenge39.go)\n- [Implement an E=3 RSA Broadcast attack](set5/challenge40.go)\n\n## Set 6\n- [Implement unpadded message recovery oracle](set6/challenge41.go)\n- [Bleichenbacher's e=3 RSA Attack](set6/challenge42.go)\n- [DSA key recovery from nonce](set6/challenge43.go)\n- [DSA nonce recovery from repeated nonce](set6/challenge44.go)\n- [DSA parameter tampering](set6/challenge45.go)\n- [RSA parity oracle](set6/challenge46.go)\n- [Bleichenbacher's PKCS 1.5 Padding Oracle (Simple Case)](set6/challenge47.go)\n- [Bleichenbacher's PKCS 1.5 Padding Oracle (Complete Case)](set6/challenge48.go)\n\n## Set 7\n- [CBC-MAC Message Forgery](set7/challenge49.go)\n- [Hashing with CBC-MAC](set7/challenge50.go)\n- [Compression Ratio Side-Channel Attacks](set7/challenge51.go)\n- [Iterated Hash Function Multicollisions](set7/challenge52.go)\n- [Kelsey and Schneier's Expandable Messages](set7/challenge53.go)\n- [Kelsey and Kohno's Nostradamus Attack](set7/challenge54.go)\n- [MD4 Collisions](set7/challenge55.go)\n- [RC4 Single-Byte Biases](set7/challenge56.go)\n\n## Set 8\n- [Diffie-Hellman Revisited: Small Subgroup Confinement](set8/challenge57.go)\n- Pollard's Method for Catching Kangaroos\n- Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks\n- Single-Coordinate Ladders and Insecure Twists\n- Duplicate-Signature Key Selection in ECDSA (and RSA)\n- Key-Recovery Attacks on ECDSA with Biased Nonces\n- Key-Recovery Attacks on GCM with Repeated Nonces\n- Key-Recovery Attacks on GCM with a Truncated MAC\n- Truncated-MAC GCM Revisited: Improving the Key-Recovery Attack via Ciphertext Length Extension\n- Exploiting Implementation Errors in Diffie-Hellman\n\n## Set 9\nI found an [unofficial set 9](https://ilchen.github.io/cryptopals/newproblems.html) by Andrei Ilchenko.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falokmenghrajani%2Fgo-cryptopals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falokmenghrajani%2Fgo-cryptopals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falokmenghrajani%2Fgo-cryptopals/lists"}