Documentation
¶
Index ¶
- func Base64Decrypt(ciphertext []byte) ([]byte, error)
- func Base64Encrypt(plaintext []byte) []byte
- func GenerateKeyPairs(bits int) (*rsa.PrivateKey, error)
- func ROTDecrypt(ciphertext string, offset uint) string
- func ROTEncrypt(plaintext string, offset uint) (res string)
- func RSADecrypt(ciphertext []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSAEncrypt(plaintext []byte, keySize int) (ciphertext []byte, publicKey *rsa.PublicKey, privateKey *rsa.PrivateKey, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decrypt ¶
Base64Decrypt decodes a base64 encoded string and returns result.
func Base64Encrypt ¶
Base64Encrypt performs base64 encoding on plaintext and returns it
func GenerateKeyPairs ¶
func GenerateKeyPairs(bits int) (*rsa.PrivateKey, error)
GenerateKeyPairs generates private and public keys for RSA encryption. the returned type: *rsa.PrivateKey contains the public key under the field named: PublicKey
func ROTDecrypt ¶
ROTDecrypt performs ROTn decryption on plaintext and returns it. The offset specified is taken as a negative value by the function, using which, ROTn operation is performed.
func ROTEncrypt ¶
ROTEncrypt performs a ROTn encryption on [plaintext] using [offset] and returns it. It is important to note that the ROT encryption performed on plaintext is using right-hand rotation of the text.
func RSADecrypt ¶
func RSADecrypt(ciphertext []byte, privateKey *rsa.PrivateKey) ([]byte, error)
RSADecrypt decrypts ciphertext using privateKey and returns the plaintext thus obtained.
func RSAEncrypt ¶
func RSAEncrypt(plaintext []byte, keySize int) (ciphertext []byte, publicKey *rsa.PublicKey, privateKey *rsa.PrivateKey, err error)
RSAEncrypt encrypts plaintext using the RSA (Rivest–Shamir–Adleman) encryption algorithm.
Types ¶
This section is empty.