Versions in this module Expand all Collapse all v1 v1.0.0 Apr 10, 2026 Changes in this version + type Argon2Crypto struct + Iterations uint32 + KeyLength uint32 + Memory uint32 + Parallelism uint8 + SaltLength uint32 + func NewArgon2Crypto() *Argon2Crypto + func (a *Argon2Crypto) Encrypt(password string) (string, error) + func (a *Argon2Crypto) Verify(password, encrypted string) (bool, error) + type BCryptCrypto struct + func NewBCryptCrypto() *BCryptCrypto + func (b *BCryptCrypto) Encrypt(password string) (encrypted string, err error) + func (b *BCryptCrypto) Verify(password, encrypted string) (bool, error) + type Crypto interface + Encrypt func(plainPassword string) (encrypted string, err error) + Verify func(plainPassword, encrypted string) (bool, error) + func CreateCrypto(algorithm string) (Crypto, error) + type ECDHCrypto struct + func NewECDHCrypto() (*ECDHCrypto, error) + func (e *ECDHCrypto) DeriveSharedSecret(publicKey string) ([]byte, error) + func (e *ECDHCrypto) Encrypt(plainPassword string) (string, error) + func (e *ECDHCrypto) Verify(plainPassword, encrypted string) (bool, error) + type ECDSACrypto struct + func NewECDSACrypto() (*ECDSACrypto, error) + func (e *ECDSACrypto) Encrypt(plainPassword string) (string, error) + func (e *ECDSACrypto) Verify(plainPassword, encrypted string) (bool, error) + type HMACCrypto struct + func NewHMACCrypto(secretKey string) *HMACCrypto + func (h *HMACCrypto) Encrypt(data string) (string, error) + func (h *HMACCrypto) Verify(data, encrypted string) (bool, error) + type PBKDF2Crypto struct + Hash func() hash.Hash + HashName string + Iterations int + KeyLength int + func NewPBKDF2Crypto() *PBKDF2Crypto + func NewPBKDF2WithSHA512() *PBKDF2Crypto + func (p *PBKDF2Crypto) Encrypt(password string) (string, error) + func (p *PBKDF2Crypto) Verify(password, encrypted string) (bool, error) + type RSACrypto struct + func NewRSACrypto(keySize int) (*RSACrypto, error) + func (r *RSACrypto) Decrypt(encryptedData string) (string, error) + func (r *RSACrypto) Encrypt(data string) (string, error) + func (r *RSACrypto) ExportPrivateKey() (string, error) + func (r *RSACrypto) ExportPublicKey() (string, error) + type SHACrypto struct + Hash func() hash.Hash + HashName string + SaltLength int + func NewSHA256Crypto() *SHACrypto + func NewSHA512Crypto() *SHACrypto + func (s *SHACrypto) Encrypt(password string) (string, error) + func (s *SHACrypto) Verify(password, encrypted string) (bool, error)