Registry / crypto / aead-chacha20

aead-chacha20

JSON →
library0.0.0-20180709150244-8b13a72661dagogounverified

Package chacha20 implements the ChaCha20 and XChaCha20 stream ciphers.

go get github.com/aead/chacha20
INSTALL
IMPORT
SIG · AEAD-CHACHA20
A
aead-chacha20
cryptogov0.0.0-20180709150244-8b13a72661da
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

chacha20
github.com/aead/chacha20

Encrypt data using ChaCha20 with a 64-bit nonce.

package main import ( "fmt" "github.com/aead/chacha20" ) func main() { key := make([]byte, 32) nonce := make([]byte, 8) cipher, err := chacha20.NewCipher(key, nonce) if err != nil { fmt.Println(err) return } src := []byte("hello") dst := make([]byte, len(src)) cipher.XORKeyStream(dst, src) fmt.Println(dst) }
Debug
Known issues
breakingNonce must be unique per key; reuse breaks security.
fix
Always use a fresh nonce for each encryption with the same key.
affects: all
Upgrade
Version history
0.0.0-20180709150244-8b13a72661dalatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
28
Resources
aead-chacha20 — go get aead-chacha20 · libregistry