Documentation
¶
Index ¶
- func BcryptHash(tohash []byte) ([]byte, error)
- func BycrptVerify(comparable, verifiable []byte) error
- func DecodeBase32Key(encodedKey string) ([]byte, error)
- func Decrypt(data, passphrase []byte) []byte
- func DecryptFile(filePath string, passphrase []byte) []byte
- func Encrypt(data, passphrase []byte) []byte
- func EncryptFile(filePath string, data, passphrase []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BcryptHash ¶
BcryptHash hashes a given byte array with bcrypt and a cost of 10
func BycrptVerify ¶
BycrptVerify compares a bcrypted comparable and its plain byte array
func DecodeBase32Key ¶
DecodeBase32Key Decodes a base32 encoded key to a byte array
func Decrypt ¶
Decrypt takes in two byte arrays. The former one is the encrypted data, the second one is the passphrase that shall be used. The method returns the decrypted data in another byte array Attention: It is assumed that a nonce is appended to the encrypted byte array!
func DecryptFile ¶
DecryptFile takes a filePath as a string and a passphrase as a byte array. The file found at filePath is then decrypted using the Decrypt Method and then wrote back to the original filePath
func Encrypt ¶
Encrypt takes in a byte array as data and another byte array as the passphrase, encrypts the data using the AES cipher and returns the encrypted data (also as byte array) please note that the nonce needed to encrypt the data using AES GCM is appended to the byte array
func EncryptFile ¶
EncryptFile takes a filePath as a string and a passphrase as a byte array. The file found at filePath is then Encrypted using the Encrypt Method and then wrote back to the original filePath
Types ¶
This section is empty.