The RSA crypto-system in Elm.
generate : Basics.Int -> Basics.Int -> Result GenerationError ( PublicKey, PrivateKey )
Generates a key-pair for the RSA crypto-system.
The arguments should be two primes. Note that the primes should remain private.
The private keys of the RSA crypto-system.
Uses to decrypt
a message.
{ n : Basics.Int, e : Basics.Int }
The public keys of the RSA crypto-system.
Used to encrypt
a message.
encrypt : PublicKey -> Basics.Int -> Basics.Int
Encrypts a message.
decrypt : PrivateKey -> Basics.Int -> Basics.Int
Decrypts a message.
The reason why a key-pair generation can go wrong.
errorString : GenerationError -> String
Returns a String
detailing why the key-pair generation failed.
let
( public, private ) =
generate 37 79
in
encrypt public value