Documentation
¶
Index ¶
- func Decrypt(ciphertext []byte, key [32]byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte) (ciphertext []byte, key [32]byte)
- func GenerateKey() [32]byte
- func Hash(tag string, data []byte) (sum []byte)
- func IsPasswordValid(ciphertext, plaintext []byte) bool
- func NewServer(mux *http.ServeMux, domains ...string) *http.Server
- func Password(plaintext []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt takes an encrypted byte slice (ciphertext) and a 256-bit AES key, and decrypts the ciphertext using AES-GCM.
func Encrypt ¶
Encrypt takes an input byte slice (plaintext) and encrypts it using AES-GCM. It returns the encrypted data (ciphertext) and the key used for encryption.
func GenerateKey ¶
func GenerateKey() [32]byte
GenerateKey generates a 256-bit (32-byte) random key for AES encryption. It uses a cryptographically secure random number generator.
func IsPasswordValid ¶
IsPasswordValid checks if a given plaintext password matches a hashed password.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.