Documentation ¶
Index ¶
Constants ¶
const SALT_SIZE = 16
Variables ¶
This section is empty.
Functions ¶
func ExtractSalt ¶
ExtractSalt separates salt and ciphertext
func GenerateSalt ¶
GenerateSalte securely generates a len(SALT_SIZE) byte salt
func PrependSalt ¶
PrependSalt prepends salt to the ciphertext
Types ¶
type AES256Decrypter ¶
type AES256Decrypter struct { // Passphrase to be used to decrypt the AES256 ciphered blocks Passphrase string }
AES256Decrypter implements the Decrypter interface. Provided a Passphrase it exposes a Decrypt method to read the content of AES256 encrypted bytes.
func NewAES256Decrypter ¶
func NewAES256Decrypter(p string) *AES256Decrypter
NewAES256Decrypter builds a new AES256Decrypter object from Passphrase. The returned object can then be used against AES256 encrypted bytes using this Passphrase using the Decrypt method.
See Decrypter interface.
type AES256Encrypter ¶
type AES256Encrypter struct {
Key *AES256Key
}
AES256Encrypter implements the Encrypter interface. Provided a AES256Key object it exposes a Encrypt method to encrypt provided plain bytes using AES256 algorithm.
func NewAES256Encrypter ¶
func NewAES256Encrypter(Passphrase string, salt []byte) (*AES256Encrypter, error)
NewAES256Encrypter builds a new AES256Encrypter object from provided passphrase and salt. The returned object can then be used against byte slices to encrypt them with the AES256 encryption algorithm using the Encrypt method.
See Encrypter interface.
type AES256Key ¶
type AES256Key struct {
// contains filtered or unexported fields
}
func MakeAES256Key ¶
make an AES key. Pass nil as salt if you want to generate a new one otherwise pass the salt from the message and you will get the key will use scrypt to make it semi secure
func NewAES256Key ¶
Generate a new AES256 key from a key and salt