Module: Threencr

Defined in:
lib/3ncr.rb,
lib/threencr/version.rb

Overview

3ncr.org v1 string encryption.

Envelope format: 3ncr.org/1#<base64(iv || ciphertext || tag)> using AES-256-GCM and base64 without padding. The envelope is agnostic of how the 32-byte AES key was derived; pick a constructor based on the entropy of the input secret.

See 3ncr.org/1/ for the full specification.

Defined Under Namespace

Classes: Error, TokenCrypt

Constant Summary collapse

HEADER_V1 =
"3ncr.org/1#"
AES_KEY_SIZE =
32
IV_SIZE =
12
TAG_SIZE =
16
ARGON2ID_MEMORY_KIB =

3ncr.org recommended Argon2id parameters (see 3ncr.org/1/ —Key Derivation section).

19_456
ARGON2ID_TIME_COST =
2
ARGON2ID_PARALLELISM =
1
ARGON2ID_MIN_SALT_BYTES =
16
VERSION =
"1.0.0"