crypt

package
v9.0.0-...-8506f1a Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 9 Imported by: 0

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 DecryptChaCha

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

DecryptChaCha will encrypt 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 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 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