xsalsa20symmetric

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCiphertextLen = errors.New("xsalsa20symmetric: ciphertext is too short")
	ErrCiphertextDecryption = errors.New("xsalsa20symmetric: ciphertext decryption failed")
)

Functions

func DecryptSymmetric

func DecryptSymmetric(ciphertext []byte, secret []byte) (plaintext []byte, err error)

secret must be 32 bytes long. Use something like Sha256(Bcrypt(passphrase)) The ciphertext is (secretbox.Overhead + 24) bytes longer than the plaintext.

func EncryptSymmetric

func EncryptSymmetric(plaintext []byte, secret []byte) (ciphertext []byte)

secret must be 32 bytes long. Use something like Sha256(Bcrypt(passphrase)) The ciphertext is (secretbox.Overhead + 24) bytes longer than the plaintext.

Types

This section is empty.

Jump to

Keyboard shortcuts

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