Example project for creating assymetric key cyphers in Rust based on the RSA algorithm.
The solution is heavily under development and is meant for educational purposes only. (mostly for myself) The current solution barely works for very low prime numbers.
A bug-ridden early implementation of the RSA-like encryption, Kid-RSA, can be found in kid_rsa.rs
. Please check the tests and the FIXME to see the current state.
Requirements:
- The private and public keys are different.
- The message is smaller than n. The algortihm is mod n based, messages longer than n does not make sense.
- TODO
Use the official guide to get your environment working: Install Rust
Use standard cargo
commands to build/test/run.
Inventory of stuff you need to know:
Algorithms:
Maths:
- Modular Arithmetic
- Fermat's Little Theorem
- Coprime integers (relative primes)
- Euler's totient function
- Modular multiplicative inverse
- Extended Euclidean algorithm
- Bézout's theorem
- Fermat number
Additional learning materials: