Package rsa

Package rsa implements RSA encrypt and decrypt operations. The practical key sizes are <= 512 bits i.e. this must not be used in any real life applications.


const E65537 = 65537

E65537 is the public RSA exponent 2^16+1.


This section is empty.


func Decrypt
func Decrypt(cipher, d, n uint) uint

Decrypt decrypts the cipher text with the private key {d, n}.

   message = cipher**d mod n
func Encrypt
func Encrypt(msg, e, n uint) uint

Encrypt encrypts the message with the public key {e, n}.

   cipher = msg**e mod n


This section is empty.