crypt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encrypted []byte, key []byte) (plaintext []byte, err error)

Decrypt using the pre-generated key

func DecryptAEAD

func DecryptAEAD(encrypted []byte, aead cipher.AEAD) (plaintext []byte, err error)

DecryptAEAD decrypts data produced by Encrypt or EncryptAEAD using reusable AEAD state.

func DecryptAEADInPlace

func DecryptAEADInPlace(encrypted []byte, aead cipher.AEAD) (plaintext []byte, err error)

DecryptAEADInPlace authenticates and decrypts into the ciphertext portion of encrypted, avoiding a payload-sized allocation in transfer receive loops.

func DecryptChaCha

func DecryptChaCha(encryptedMsg []byte, aead cipher.AEAD) (plaintext []byte, err error)

DecryptChaCha will decrypt ChaCha20-Poly1305 using the pre-generated key https://pkg.go.dev/golang.org/x/crypto/chacha20poly1305

func Encrypt

func Encrypt(plaintext []byte, key []byte) (encrypted []byte, err error)

Encrypt will encrypt using the pre-generated key

func EncryptAEAD

func EncryptAEAD(plaintext []byte, aead cipher.AEAD) (encrypted []byte, err error)

EncryptAEAD encrypts plaintext with reusable AEAD state. Its wire format is identical to Encrypt: nonce followed by ciphertext and authentication tag.

func EncryptAEADTo

func EncryptAEADTo(dst, plaintext []byte, aead cipher.AEAD) (encrypted []byte, err error)

EncryptAEADTo encrypts into dst when it has sufficient capacity, allowing transfer loops to reuse their ciphertext buffer across chunks.

func EncryptChaCha

func EncryptChaCha(plaintext []byte, aead cipher.AEAD) (encrypted []byte, err error)

EncryptChaCha will encrypt ChaCha20-Poly1305 using the pre-generated key https://pkg.go.dev/golang.org/x/crypto/chacha20poly1305

func New

func New(passphrase []byte, usersalt []byte) (key []byte, salt []byte, err error)

New generates a new key based on a passphrase and salt

func NewAESGCM

func NewAESGCM(key []byte) (cipher.AEAD, error)

NewAESGCM constructs reusable AES-GCM state for a transfer connection.

func NewArgon2

func NewArgon2(passphrase []byte, usersalt []byte) (aead cipher.AEAD, salt []byte, err error)

NewArgon2 generates a new key based on a passphrase and salt using argon2 https://pkg.go.dev/golang.org/x/crypto/argon2

Types

This section is empty.

Jump to

Keyboard shortcuts

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