ubgo is in early alpha: libraries and APIs may still change.

Skip to content
ubgo Alpha

crypt

Go crypto with safe defaults (AES-GCM, ChaCha20-Poly1305, argon2id, HMAC, Ed25519, key rotation), byte-compatible with crypt-ts.

go get github.com/ubgo/crypt
Language
Go
Go version
1.25.0
Core deps
1 direct
Latest tag
v0.2.0
License
Apache-2.0
Go modules
1

Highlights from the README

  • AES-CBC instead of GCM (no authentication).
  • A “default” key string committed to source.
  • bytes.Equal for HMAC verification (timing leak).
  • Argon2 with hand-tuned parameters that drift from OWASP recommendations.
  • A wire format that the Node sibling decodes wrong for any plaintext > 16 bytes.

Code from the README

import "github.com/ubgo/crypt"

key, _ := crypt.RandomBytes(crypt.AEADKeySize)
ct, _ := crypt.Seal(key, []byte("hello, world"), nil)
pt, _ := crypt.Open(key, ct, nil)
// pt == []byte("hello, world")

From the crypt README.