#rsa #encryption #sign #secret-key #development-tools #assymetric

rsa-rust

A crate to build RSA KeyPairs and Encrypt/Decrypt&Sign info

2 releases

0.1.1 Mar 12, 2019
0.1.0 Mar 12, 2019

#22 in #development-tools

MIT license

26KB
446 lines

Rust-rsa

This is an implementation of the RSA algorithm in Rust.

DISCLAIMER: THIS IS A PERSONAL PROJECT JUST FOR FUN. DO NOT USE THIS LIBRARY ON PRODUCTION ENVOIRMENTS SINCE IS NOT DESIGNED FOR THAT KIND OF PURPOSES

TODO:

  • Generate big numbers of 1024 bits and 2048 bits.
  • Implement modular exponentiation operation needed by Rabin-Miller algorithm. (TESTED AND WORKING)
  • Implement Rabin Miller algorithm. (TESTED AND WORKING)
  • Implement Extended Euclides Algorithm to search for mcd of two suposed prime numbers.
  • Generate valid KeyPairs of a deterministic lenght. (TESTED AND WORKING. RECOMMENDED THRESHOLD:DEFAULT // RECOMENDED KEYPAIR SIZE: 512 OR 1024 BITS)
  • Encrypt messages with Public Key.
  • Decrypt messages with Secret Key. (TESTED AND WORKING)
  • Implement From trait for Public, Secret and KeyPair.
  • Implement Parallel computations of p & q prime original numbers to increase performance. (Increased performance (Still depending of randomness and Prime proximity))
  • Implement Hybrid encryption process using AES-128/256 (to determine).
  • Optimize Rabin-Miller algorithm by discarting multiples of [3, 5, 7, 9, 11, 13, 15, 19] before start computing the algorythm. (Increased performance)
  • Paralelize Rabin-Miller Iterations to increase Key Generation performance.
  • Brenchmark Rabin-Miller vs. Fermat's Primality test (see: https://en.wikipedia.org/wiki/Fermat_primality_test. Not considering Baillie–PSW since relies on Rabin-Miller.
  • Sign messages.
  • Implement Paddings (PKCS1, PKCS7, PKCS-OAP)
  • Order and write better tests.

Dependencies

~2MB
~35K SLoC