OxL Reference

method aead.seal

AES-256-GCM.

Example:

oxl✓ checked in CI
use std.crypto { aead, rand }
use std.ser { bytesOf, textOf }

fn main() io, rand {
  let key = rand.secure(32)
  let sealed = aead.seal(key, bytesOf(&"secret"))!
  print(textOf(&aead.unseal(key, sealed)!)!)
}
Output
secret
pub(api) static fn seal(key: bytes, plain: bytes, aad: bytes = b"") -> bytes | CryptoError  rand

Since. 1.0.0-beta

Parameters

NameType
keybytes
plainbytes
aadbytes = b""

Returns

bytes

Errors

Effects

rand

Defined in: std/crypto/crypto.oxl:451

See also