Documentation ¶
Index ¶
- func DecryptAESKey(encryptedAESKey []byte, privateKey rsa.PrivateKey) []byte
- func DecryptFile(filename string, extension string, aeskey *[]byte)
- func EncryptAESKey(aesBytes *[]byte, pubkey rsa.PublicKey) []byte
- func EncryptFile(filename string, extension string, aeskey *[]byte)
- func GenerateAES(aesBytes *[]byte)
- func GenerateRSA() *rsa.PrivateKey
- func LoadAESKey(aesKey *[]byte, filename string)
- func LoadRSAPrivateKey(filename string) *rsa.PrivateKey
- func LoadRSAPublicKey(fileName string) rsa.PublicKey
- func SaveAESKey(aesBytes []byte, fileName string)
- func SaveRSAPrivateKey(privateKey rsa.PrivateKey, fileName string)
- func SaveRSAPublicKey(publicKey rsa.PublicKey, fileName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAESKey ¶
func DecryptAESKey(encryptedAESKey []byte, privateKey rsa.PrivateKey) []byte
Decrypt the AES key with the RSA private key
func DecryptFile ¶
func EncryptAESKey ¶
Encrypt the AES key with OAEP RSA public key
func EncryptFile ¶
func LoadAESKey ¶
Read hex encoded AES key from file and return byte array. Key can be encrypted or unencrypted, but must be hex encoded
func LoadRSAPrivateKey ¶
func LoadRSAPrivateKey(filename string) *rsa.PrivateKey
Reads RSA key formatted in x509 PKCS1 from file and returns the key value in type 'rsa.PrivateKey'
func LoadRSAPublicKey ¶
func SaveAESKey ¶
Save AES key to file system, hex encoded. Key can be plaintext or encrypted This function is insecure, and should not be used in a live demo when testing security controls
func SaveRSAPrivateKey ¶
func SaveRSAPrivateKey(privateKey rsa.PrivateKey, fileName string)
Saves RSA private key to file in x509 PKCS1 format This function should never be performed on the target system that is used for testing security controls
func SaveRSAPublicKey ¶
Types ¶
This section is empty.