Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt decrypts an encrypted value when the key is equal to the key used in the Encrypt method
func Encrypt ¶
Encrypt encrypts data using AES-256 with the key provided Key must have a minimum of 16 chars
func HashSha512String ¶
HashSha512String hashes a string using sha512 and returns the results hex encoded
func NormalizeKey ¶
NormalizeKey returns a fixed length key of 32 bytes
Types ¶
type EncryptReader ¶
type EncryptReader struct {
// contains filtered or unexported fields
}
EncryptReader decrypts files using the io.Reader
func NewEncryptReader ¶
func NewEncryptReader(key []byte, source io.Reader) (*EncryptReader, error)
NewEncryptReader creates a new instance of the encrypt reader This can read from another reader where the data is encrypted using EncryptWriter
type EncryptWriter ¶
type EncryptWriter struct {
// contains filtered or unexported fields
}
EncryptWriter encrypts files using the io.Writer interface and writes the output directly to another io.Writer This is handy to use when you want to encrypt a large amount of data
func NewEncryptWriter ¶
func NewEncryptWriter(key []byte, dst io.Writer) (*EncryptWriter, error)
NewEncryptWriter creates a new instance of the encrypt writer
func (*EncryptWriter) Close ¶
func (ew *EncryptWriter) Close() error
Close Implements io.Closer This writes the remaining data to the underlying writer