Skip to content

C++ library containing many types of ciphers, functions and data manipulation algorithms to encrypt or decrypt any messages.

License

Notifications You must be signed in to change notification settings

glapointe7/CryptoGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

CryptoGL is a C++ library containing classical ciphers, symmetric ciphers, asymmetric ciphers, hash functions, sponge functions, checksum functions and some other tools for strings, vectors, grids, manipulation of bits and mathematical purpuses. All the CPP and HPP files are found in the src folder.

The UnitTests folder contains the unit tests framework and all tests done for the cryptographic algorithms and some other tools. Each algorithm contains tests in a HPP file. A report is generated for all tests performed (have a look in main.cpp file).

Compilation

CryptoGL has been compiled successfully with g++11 in VSCode.

CryptoGL can also be compiled using cmake. Have a look at the last section of this readme file (Execution with CMake).

Cryptographic algorithms

Classical ciphers

  • ADFGVX
  • Caesar
  • Vigenere, Rozier, Beaufort, Beaufort (German variant) and Vigenere Multiplicative
  • Chao
  • Collon
  • Delastelle
  • Fleissner
  • 2-square, 3-square and 4-square
  • Hill
  • Morse
  • Monoalphabetic Substitution
  • Nihiliste
  • Playfair
  • Polibius
  • Railfence, Redefence and Redefence Zigzag
  • Transpositions
  • Wolseley
  • Affine

Block ciphers

  • AES
  • DES
  • Blowfish
  • IDEA
  • Skipjack
  • RC2, RC5 and RC6
  • TripleDES
  • XTEA
  • Noekeon
  • CAST-128 and CAST-256
  • Twofish
  • Camellia
  • MYSTY1

For each block cipher, the ECB, CBC, CFB, OFB and CTR modes of operation are implemented following the specifications of NIST.

Stream ciphers and Pseudo-random functions

  • Rabbit
  • RC4
  • SEAL
  • ISAAC
  • HC-256
  • Salsa20
  • Scream-S, Scream-0
  • Snow3G

Asymmetric ciphers

  • Hellman-Merkle Knapsack cryptosystem, RSA (to come)

These algorithms are using a BigInteger library created by Matt McCutchen

Hash functions

  • Blake (224, 256, 384, 512)
  • SHA-1
  • SHA-2 (224, 256, 384, 512, 512/224, 512/256)
  • MD2, MD4, MD5
  • RipeMD (128, 160, 256, 320)
  • Whirlpool
  • Tiger and tiger2 (128, 160, 192)
  • HMAC is supported for all of them.

Sponge construction functions

  • Keccak (0, 224, 256, 384, 512)

Checksum functions

  • LRC (Longitudinal redundancy check)
  • Adler-32

MAC algorithms

  • CBC-MAC
  • AES-XCBC-MAC
  • CMAC
  • PMAC
  • OMAC
  • TMAC
  • HMAC

Other tools

  • Base64
  • Square matrices over the modular integers $\mathbb{Z}_n$
  • Functions composition
  • Big and little endian conversions
  • Various mathematical tools
  • Vectors extending the STL vectors
  • Strings extending the STL strings
  • Padding Schemes
  • Bits manipulation tools

Execution with CMake

Here is the procedure to execute the tests in the terminal with cmake:

  1. mkdir Build
  2. cd Build
  3. cmake ..
  4. make CryptoGL
  5. (To get the result in a file): ./CryptoGL | perl -pe 's/\e\[?.*?[\@-~]//g' &> CryptoGL_TestsReport.txt
  6. (To get the result on terminal): ./CryptoGL

About

C++ library containing many types of ciphers, functions and data manipulation algorithms to encrypt or decrypt any messages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published