Versions in this module Expand all Collapse all v1 v1.5.43 May 2, 2024 v1.5.42 May 2, 2024 Changes in this version + const ServerECCKeyPairKey + const TOTPDigits + const TOTPPeriod + const TOTPSecretKey + var ErrDecryptFailed = errors.New("decryption failed") + var ErrInvalidKeyLength = errors.New("invalid length") + var ErrReplayAttack = errors.New("replay attack detected") + func AgeDecrypt(recipientPrivateKey string, ciphertext []byte) ([]byte, error) + func AgeEncrypt(recipientPublicKey string, plaintext []byte) ([]byte, error) + func AgeKeyExFromImplant(serverPrivateKey string, implantPrivateKey string, ciphertext []byte) ([]byte, error) + func Decrypt(key [chacha20poly1305.KeySize]byte, ciphertext []byte) ([]byte, error) + func Encrypt(key [chacha20poly1305.KeySize]byte, plaintext []byte) ([]byte, error) + func KeyFromBytes(data []byte) ([chacha20poly1305.KeySize]byte, error) + func MinisignServerPrivateKey() *minisign.PrivateKey + func MinisignServerPublicKey() string + func MinisignServerSign(message []byte) string + func RandomKey() [chacha20poly1305.KeySize]byte + func TOTPOptions() totp.ValidateOpts + func TOTPServerSecret() (string, error) + func ValidateTOTP(code string) (bool, error) + type AgeKeyPair struct + Private string + Public string + func ECCServerKeyPair() *AgeKeyPair + func RandomAgeKeyPair() (*AgeKeyPair, error) + func (e *AgeKeyPair) PrivateKey() string + func (e *AgeKeyPair) PublicKey() *age.X25519Recipient + type CipherContext struct + Key [chacha20poly1305.KeySize]byte + func NewCipherContext(key [chacha20poly1305.KeySize]byte) *CipherContext + func (c *CipherContext) Decrypt(ciphertext []byte) ([]byte, error) + func (c *CipherContext) Encrypt(plaintext []byte) ([]byte, error)