/crypto-hacks

CTF challenges from the Cryptohack Cryptography course.

Primary LanguageOCaml

CryptoHack

A free, fun platform for learning modern cryptography

Solutions for Various Challenges implemented in Ocaml

Crypto Camel

https://cryptohack.org/

The lib folder contains my solutions to the Introduction to Cryptohacks course and some of the Modular Arithmatic lessons. I won't include any challenges outside of those "starter problems so as not to spoil the challenge for anyone else.

Crytpohacks uses (and recommends) python as the language of choice for the content but as you'll quickly find out, I used Ocaml.

I definitely think Python is better suited for cryptography and there are alot of libraries that make solving the challenges here a breeze. I mostly wanted to use Ocaml beause i thought it would be a fun way to learn the language and really understand what is going on when I solve a challenge.

Ocaml's syntax really grew on me as I wrote more code and I find it has more of a flow than Python so I encourage anyone who is interested to give Ocaml a try and see if you can solve some Cryptography puzzles with it! Happy coding!

Useful References & Notes

Quadratic Residues

Modular Square Root Examples

In modular arithmetic the negative of a number, a mod n can be found as: $$−a≡n−a(mod \ n)$$

Modules Used:

  1. Str - https://ocaml.org/manual/5.1/api/Str.html
  2. Zarith
  3. Hex
  4. Base_64