Simple implementation gem of the RSA algorithm. Just academic reasons.
# key generation
RSA.generated
# encode
RSA.encode('oi')
# decode
RSA.decode(RSA.encode('oi'))
## For encoding
RSA::OPEN::Public.n= <number>
RSA::OPEN::Public.e= <number>
RSA.encode('oi')
## For decoding
RSA::OPEN::Private.n = <number>
RSA::OPEN::Private.d = <number>
RSA.decode(RSA.encode('oi'))
Example folder. Intended for example using this gem
-
Simple
Simplest way would be throughRSA.generated
. That way you will have the keys created in thekeys
folder and you can use -
Open keys
You can use open keys, for those not generated through
RSA.generated
that way you can set externally.
make up
ruby test/all_test.rb