Documentation ¶
Index ¶
- Variables
- func Decrypt(encrypted string, passphrase string) (decrypted []byte, err error)
- func DecryptByte(data []byte, passphrase []byte, salt []byte, iv []byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte, passphrase string) string
- func EncryptByte(plaintext []byte, passphrase []byte) (encrypted []byte, salt []byte, iv []byte)
Constants ¶
This section is empty.
Variables ¶
var Iter = 500
Iter is the iteration count for pbkdf2. Using a higher iteration count will increase the cost of an exhaustive search but will also make derivation proportionally slower.
Functions ¶
func Decrypt ¶
Decrypt string of form `iv.salt.encrypted` to the byte of its original. Throws error if the decryption fails.
func DecryptByte ¶
func DecryptByte(data []byte, passphrase []byte, salt []byte, iv []byte) (plaintext []byte, err error)
DecryptByte using pdbkdf2 decyprtion as specified by NIST to decrypt bytes based on a passphrase, a salt, and an IV.
func Encrypt ¶
Encrypt byte using string passphrase into a string `iv.salt.encrypted` which each piece (iv, salt, encrypted) is base64 encoded. Can be decrypted using Decrypt.
func EncryptByte ¶
EncryptByte using pdbkdf2 encryption as specified by NIST. See Section 8.2 of http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf for more information.
Types ¶
This section is empty.