Wednesday, June 13, 2012

Large integer arithmetic and public key cryptography in Objective-C

I finished act-I of my little quest to learn Objective-C. I implemented FGInt, a library for large integer arithmetic and with it I implemented some public key cryptography algorithms: RSA, ElGamal, DSA and GOSTDSA. You can download them here.
It was not as straightforward as I wanted it to be because Objective-C turned out to be a lot slower than I expected. Lots of optimizations needed, and I am still not satisfied with the speed of addition. All the other operations perform reasonably. I compared it to my previous work, FGInt for FreePascal, and managed to reduce the difference in speed to below a factor of 1.5.
Update (27/6/2012): Elliptic Curve Arithmetic, ECDSA and ECElGamal added.
Update (20/5/2014): Moved to GitHub.