Documentation ¶
Index ¶
- Variables
- func DecryptPathItems(key []byte, path string, encryptedReader io.Reader) (string, io.ReadCloser, error)
- func EncryptPathItems(key []byte, path string, plainReader io.Reader) (string, io.Reader, error)
- func NewDecryptReader(r io.Reader, aesKey, iv, hmacKey []byte) (io.ReadCloser, error)
- func NewEncryptReader(r io.Reader, aesKey, iv, hmacKey []byte) (io.Reader, error)
Constants ¶
This section is empty.
Variables ¶
var DecryptErr = errors.New("message corrupt or incorrect keys")
Functions ¶
func DecryptPathItems ¶
func DecryptPathItems(key []byte, path string, encryptedReader io.Reader) (string, io.ReadCloser, error)
DecryptPathItems returns a decrypted path string and an io.Reader that reads the decrypted data from the encrypted reader passed into the function. To only decrypt a path, pass in an empty byte buffer as the reader and check only for the string result.
NOTE: key must be a 64 byte long key
func EncryptPathItems ¶
EncryptPathItems returns an encrypted path and a Reader that reads the encrypted data from the plain reader passed into the function. Encrypted data is AES-CTR of data + AES-512 HMAC of encrypted data
NOTE: key must be a 64 byte long key To decrypt the result of this function use the DecryptPathItems function
func NewDecryptReader ¶
NewDecryptReader creates an io.ReadCloser wrapping an io.Reader using the keys and iv to decode the content using AES and verify HMAC.
Types ¶
This section is empty.