Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

tabarra/RSA_Base58_Block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSA_Base58_Block

RSA block encryption implementation in C# without using the RSACryptoServiceProvider class.

main interface

The objective of this project was to gain experience in the implementation of a trapdoor permutation cryptography, in this case RSA, and that's why I decided to not use any library or API except .NET's BigInteger and adamcaudill/Base58Check.

Features

  • Compatible with large primes (like 2048+ bits)
  • Multi-threaded random prime number generator
  • Miller-Rabin probabilistic prime number checker implementation as described in NIST FIPS 186-4 (C.3.2)
  • Four-byte padding on each block to guarantee that encoding the same message twice won't generate the same result
  • Base58 encoding of each block, split by an underscore.
  • Status bar to see how much time each operation takes
  • UTF8 compatible

Notes & Disclaimer

The intention of this project was never to make something good enough to be used in real life applications. Implementing cryptographic functions by yourself is almost never a good idea, and RSA is a great example of one cryptography very easy to screw up and end with a vulnerable code.

If you want to dive deeper in this awesome algorithm, I suggest trying to implement PEM/DER/ASN.1 key parsing, Chinese Remainder Theorem, increasing it's compatibility with PKCS1 2v2, reading Dan Boneh's Twenty Years of Attacks on the RSA Cryptosystem paper or any of his lectures on the subject. You may also want to check LINKS.md, where I saved many pages that helped me to understand RSA.

PS.: This was also my first C# project, so don't expect any part of it to be optimal.

About

RSA block encryption implementation in C# without using the RSACryptoServiceProvider class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages