Skip to content

lucasg/Cryptopals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptopals

Matasano crypto challenges (http://cryptopals.com/) implemented mostly in C.

Introduction

This is a serie of 56 technical challenges around software programming and cryptography made by some people at Matasano. Every solution can be built either on Windows or on Linux (Mint and Arch tested).

The tools folder contains implementations of several standard cryptographic protocols and utilities : do not use them in production.

Requirements

  • You need to have access to the gcc toochain and basic shell commands (make, cd, sed, awk, etc.). On Windows, every challenge has been tested against the mingw32 compiler.
  • Some challenges use pythons scripts : everything has been written for Python 3xx. Older versions may or may not work.
  • pip requirements :
    • On Linux, install pip3 : sudo (apt-get install | yum install | pacman -S) python3-pip to prevent name clashing with the system-wide pip binary.
    • bottle web framework for challenges 31 & 32
    • tkinter for challenge 20
  • libcurl : challenge 31 & 32 use libcurl to make requests to a remote webpage.
    • Libcurl isn't installed by default on Windows, so you will need to download the static library compatible with your compiler (or build it yourself) and placing it in the corresponding's lib folder. Download page : http://curl.haxx.se/download.html
    • On Unix systems, you can either use libcurl statically of dynamically (modify the Makefile to your needs). Don't forget to add the installed lib folder (something like /usr/lib/x86_64-linux-gnu ) in the LDFLAGS.

Usage

The Makefile located in the root folder contains every useful commands, while global.mk has every project-wide variables.

Ex :

  • make 01 all will build all the targets in first challenge.
  • make tools will build all the necessary libraries and bins in the tools folder.
  • make exos clean will run make clean on every challenges.
  • make exos build will run make build on every challenges, building the binary. (make whill aslo do the same)
  • make exos solve will run make solve on every challenges, building the binary and running it.
  • make 01 07 09 solve will run make solve on challenge 01, 07 and 09.

Caveat : challenge #31 & #32 can't be called from the top-level Makefile since you need to fire up a websever. To test the challenge , you need to type :

  • cd "[$ex]_..."
  • make webserver on one terminal
  • make solve on an another terminal

Set 1

Set 2

Set 3

Set 4

Set 5

Set 6

Set 7


Licensing

My own code is free to use (attribution is nice, but not mandatory). Other licenses :

  • curl : libcurl has a fairy complicated license mix. Since I only link against the lib, my work is not derivative and is not subject to libcurl's licenses.
  • mini-gmp is doubly licensed GPL and LGPL.
  • sha1 is copied from polarSSL/mbed is GPL also.
  • sha256 is copied from Brad conte crypto-algorithms and is copyleft.
  • rsa prime generation is adapted from SSH 1.2.0, found in MIT Athena's project (Copyright 1995 SSH Communications Security).

About

Matasano crypto challenges (http://cryptopals.com/) implemented mostly in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published