Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MacError = errors.New("invalid key - message authentication failed")
Functions ¶
This section is empty.
Types ¶
type CipherText ¶
type CipherText struct { IV []byte `json:"iv"` CipherText []byte `json:"cipher_text"` Mac []byte `json:"mac"` Version uint8 `json:"v"` }
func CFBEncrypt ¶
func CFBEncrypt(plainText PlainText, key Secret) (CipherText, error)
encrypt a plain text with given secret Deprecated: use CTREncrypt instead
func CTREncrypt ¶
func CTREncrypt(plainText PlainText, secret Secret) (CipherText, error)
encrypt plain text by given key using AES CTR 256
type PlainText ¶
type PlainText []byte
func CFBDecrypt ¶
func CFBDecrypt(cipherText CipherText, key Secret) (PlainText, error)
decrypt a cipher text with given secret Deprecated: use CFBDecrypt instead
func CTRDecrypt ¶
func CTRDecrypt(cipherText CipherText, key Secret) (PlainText, error)
decrypt cipher text by given key
Click to show internal directories.
Click to hide internal directories.