crypto

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(text string, key *[32]byte) (plaintext string, err error)

func AESEncrypt

func AESEncrypt(plaintext string, key *[32]byte) (ciphertext string, err error)

func MD5

func MD5(text string) string

MD5 is just syntax sugar around crypto/md5

func TOTP added in v0.18.0

func TOTP(f func() hash.Hash, digits int, t int, key string) string

func TOTPAt added in v0.37.0

func TOTPAt(f func() hash.Hash, digits int, window uint64, key string) string

TOTPAt returns the password TOTP gives during the time window with the given number, where window n covers seconds [n*t, (n+1)*t) of Unix time for an interval of t seconds.

Types

type AESSealer

type AESSealer struct{}

func (*AESSealer) Seal

func (*AESSealer) Seal(message, key string) (encoded string, err error)

func (*AESSealer) Unseal

func (*AESSealer) Unseal(message, key string) (decoded string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL