link to code : https://github.com/RamiBrahimi-c/big-ar9am .
hello i am sharing with you project i did this summer , in fact it is a side project was done to be included in another side project which is a crypto lib in C and it is important to say that it is not meant for professional use at all (code : https://github.com/RamiBrahimi-c/cryptography-library ) .
the crypto lib was asked for us to do in a uni class , and due to the fact that i was not able to take my full time with it , like actually doing everything myself from scratch and not vibecode it or use openssl and GMP , so i had to kind of rely on them a little just until the deadline was over and i got marked for it , then i decided to go back to it and make it totally from the ground up .
the crypto lib has :
- hash functions ( sha256 , sha512 , md4 , md5 )
- classic ciphers ( affine , cesar , ..etc )
- symmetric ones ( aes , des , rc4 , blowfish , .. )
- asymmetric ones that requires arbitary length numbers in protocols like rsa , elgamel , and defil-hellman .
for now all of them except the asymmetric crypto were done from the ground up , i even tried not to copy block of constants if i could calculate it manually ( like the AES s-box that i generated manually by calculating it with galois fields operations in 2⁸ ) , that being said i refused to also rely on GMP to do all the calculations for me too and here where this project was born .
for now it has several features like basic arithmetic operations and even prime numbers testing , generation , finding inverse multiplicative too .. etc you can check my readme ,
yet it is also important that it is not optimized yet , i must note that it will be subjective and based on what i feel like either to go further and see how things like Karatsuba , FFT‑based (Schönhage‑Strassen) , Newton‑Raphson division , ..etc .
although it feels really interesting to see all these mentioned algorithms in action .
an other important point imo is how did i make sure it is at least calculating right , and for that i used Python 3.12.3 , it was extremily helpful and i absolutely appreciate such things like this .
and that would be it , i apologize if i drifted on the main subject i wanted to give the full picture of things , also you can read the README of both of my projects for more details especially the readme of this big num library ( i promise ai just helped with technical details , otherwise it is completely mine )
NOTE : if you want to ask about the why i did what i did , i dont have a clear answer , cuz i love to know how things work and why ? cuz i just want to make my own stuff ? for fun ?
idk , could be one of these could be all of them .
let me know your thoughts ,