Versions in this module Expand all Collapse all v0 v0.0.2 Jun 16, 2023 Changes in this version + const CIPHER_KEY_LEN + const SALT_KEY_LEN + func Sha256Hash(key string) []byte + type Decryptor interface + Decrypt func([]byte) ([]byte, error) + type EncryptTool struct + KeyLen uint32 + Memory uint32 + Passphrase []byte + Threads uint8 + Time uint32 + func New(opts ...EncryptToolOption) (*EncryptTool, error) + func (e *EncryptTool) Compare(data, hash []byte) (bool, error) + func (e *EncryptTool) Decrypt(data []byte) ([]byte, error) + func (e *EncryptTool) DeriveKey(salt []byte) ([]byte, []byte, error) + func (e *EncryptTool) Encrypt(data []byte) ([]byte, error) + func (e *EncryptTool) Hash(data []byte) ([]byte, error) + type EncryptToolOption func(*EncryptTool) + func WithKeyLen(keyLen uint32) EncryptToolOption + func WithMemory(memory uint32) EncryptToolOption + func WithPassphrase(passphrase []byte) EncryptToolOption + func WithPassphraseText(passphrase string) EncryptToolOption + func WithThreads(threads uint8) EncryptToolOption + func WithTime(time uint32) EncryptToolOption + type Encryptor interface + Encrypt func([]byte) ([]byte, error) + type Hasher interface + Compare func([]byte, []byte) (bool, error) + Hash func([]byte) ([]byte, error)