ciphers

package module
v0.0.0-...-ed43e34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePrivateKey

func DecodePrivateKey(privateKey []byte) *rsa.PrivateKey

DecodePrivateKey : decode unsealed private key to rsa.PrivateKey

func DecryptAESGCM

func DecryptAESGCM(key []byte, nonce []byte, cipherData []byte) []byte

DecryptAESGCM : decrypt data using AES GCM algorithm with provided key and nonce

func DecryptEncodedPrivateKey

func DecryptEncodedPrivateKey(privateKey []byte, keyPassword []byte) []byte

DecryptEncodedPrivateKey : unseal PEM formatted private key with password

func DecryptRSA

func DecryptRSA(privateKey *rsa.PrivateKey, data []byte) []byte

DecryptRSA : Decrypt Data with RSA private key

func EncodePrivateKey

func EncodePrivateKey(privateKey *rsa.PrivateKey) []byte

EncodePrivateKey : encode unsealed private key

func EncryptAESGCM

func EncryptAESGCM(key []byte, nonce []byte, data []byte) []byte

EncryptAESGCM : encrypt data using AES GCM algorithm with provided key and random nonce

func EncryptEncodedPrivateKey

func EncryptEncodedPrivateKey(privateKey []byte, keyPassword []byte) []byte

EncryptEncodedPrivateKey : seal PEM formatted private key with password

func EncryptRSA

func EncryptRSA(publicKey *rsa.PublicKey, data []byte) []byte

EncryptRSA : Encrypt Data with RSA public key

func GenerateAESKey

func GenerateAESKey() []byte

GenerateAESKey : Generate 256bits in length AES key

func GenerateNonce

func GenerateNonce() []byte

GenerateNonce : Generate 96 bits AESGCM nonce

func GeneratePrivateKey

func GeneratePrivateKey(size int) *rsa.PrivateKey

GeneratePrivateKey : generate rsa private key of given size

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL