Oboron CLI Specification

Spec version: v0 (initial)

Contents


1. Overview

This document specifies the CLI interface for conforming Oboron implementations. Its purpose is to enable cross-implementation conformance testing via a shared CLI contract.

Conforming implementations provide two binaries:

The reference implementation source code is available at the GitHub repo ob-enc/oboron-rs.

For cryptographic details, format definitions, and key management, see the protocol specification.


2. Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Command Syntax Notation


3. Binaries

ob

The ob binary is REQUIRED for all conforming implementations. It handles a-tier and u-tier encryption schemes.

obz

The obz binary is OPTIONAL. If provided, it MUST conform to this specification. It handles z-tier obfuscation schemes.

⚠️ Z-tier schemes are NOT cryptographically secure. obz is for obfuscation only and MUST NOT be used for sensitive data.

Comparison

Aspect ob obz
Key terminology "key" (--key/-k, 86 base64 chars, 512-bit) "secret" (--secret/-s, 43 base64 chars, 256-bit)
Config directory ~/.ob/ ~/.obz/
Default scheme aasv zrbcx
Default encoding c32 c32
Environment variable OBORON_KEY OBORON_SECRET
Key output command key (alias: k) secret (alias: s)

4. Core Commands (REQUIRED)

The following commands MUST be implemented for a conforming CLI.

4.1 enc (alias: e)

Encrypt+encode a plaintext string.

ob enc [OPTIONS] [TEXT]

Flags

Flag / Option Short Description
--key <KEY> -k Encryption key (86 base64 chars); conflicts with --profile/--keyless
--profile <NAME> -p Use named key profile; conflicts with --key/--keyless
--keyless -K Use hardcoded key (INSECURE — testing only); conflicts with --key/--profile
--format <FORMAT> -f Format string (e.g. aasv.b64); MUST NOT be combined with scheme/encoding flags
--aasv -s Use aasv scheme
--apsv -S Use apsv scheme
--aags -g Use aags scheme
--apgs -G Use apgs scheme
--upbc -u Use upbc scheme
--c32 -c Use Crockford base32 encoding
--b32 -b Use RFC base32 encoding
--b64 -B Use base64 encoding
--hex -x Use hex encoding
--help -h Print help

Behavioral Rules

obz enc Variant

obz enc accepts the same flags with these differences:

Flag Short Description
--zrbcx -r Use zrbcx scheme
--legacy -l Use legacy scheme

4.2 dec (alias: d)

Decode+decrypt an obtext string.

ob dec [OPTIONS] [TEXT]

Flags

Flag / Option Short Description
--key <KEY> -k Encryption key (86 base64 chars); conflicts with --profile/--keyless
--profile <NAME> -p Use named key profile; conflicts with --key/--keyless
--keyless -K Use hardcoded key (INSECURE — testing only); conflicts with --key/--profile
--format <FORMAT> -f Format string (e.g. aasv.b64); MUST NOT be combined with scheme/encoding flags
--aasv -s Use aasv scheme
--apsv -S Use apsv scheme
--aags -g Use aags scheme
--apgs -G Use apgs scheme
--upbc -u Use upbc scheme
--c32 -c Use Crockford base32 encoding
--b32 -b Use RFC base32 encoding
--b64 -B Use base64 encoding
--hex -x Use hex encoding
--help -h Print help

Behavioral Rules


4.3 key / secret (alias: k / s)

Output the encryption key (for ob) or obfuscation secret (for obz) for the active or specified profile.

ob key [OPTIONS]
obz secret [OPTIONS]

Flags

Option Short Description
--profile <NAME> -p Use named key profile
--keyless -K Output the hardcoded key
--hex -x Output as hex instead of base64
--help -h Print help

For obz, the command is secret (alias: s), and it outputs the 256-bit z-tier secret.


5. Management Commands (OPTIONAL)

The following commands are RECOMMENDED but not required for conformance.

5.1 init (alias: i)

Initialize configuration with a randomly-generated key profile.

ob init [NAME]

[NAME] defaults to default.

Behavioral Rules

For obz:


5.2 config (alias: c)

Manage configuration.

ob config [OPTIONS] [SUBCOMMAND]

Subcommands

Subcommand Description
show Print current configuration (default when no subcommand given)
set Set configuration values

config set

Accepts scheme flags, encoding flags, and --profile <NAME> to update the stored configuration.


5.3 profile (alias: p)

Manage key profiles.

ob profile <SUBCOMMAND>

Subcommands

Subcommand Aliases Description
list l List all key profiles
show g, get Show a specific profile (defaults to active if name omitted)
activate a, use Set a profile as the default
create c Create a new profile; --key/-k optional (generates if omitted)
delete d Delete a profile
rename r, mv Rename a profile (takes <OLD> <NEW>)
set Replace the key in an existing profile; --key/-k optional (generates if omitted)

Profile name validation: only alphanumeric characters, hyphens, and underscores are permitted.


5.4 completion

Generate shell completion scripts.

ob completion <SHELL>
Subcommand Description
bash Generate bash completion script
zsh Generate zsh completion script
fish Generate fish completion script
powershell Generate PowerShell completion script

6. Key/Secret Resolution

When resolving which key (or secret) to use, implementations MUST apply the following precedence order (highest to lowest):

Priority Source
1 --key / --secret CLI flag
2 $OBORON_KEY / $OBORON_SECRET environment variable
3 --profile <NAME> → profile file
4 Default profile from config file
5 Error

If no key source is available, the implementation MUST exit with a non-zero exit code.


7. Format Specification

The --format flag accepts format strings of the form {scheme}.{encoding}.

Scheme Identifiers

Encoding Identifiers

Identifier Description
c32 Crockford base32 (lowercase, avoids accidental obscenity words)
b32 RFC 4648 base32 (uppercase alphanumeric)
b64 URL-safe base64 (RFC 4648 §5, most compact)
hex Hexadecimal (longest output, slightly faster)

Implementations SHOULD support the named scheme flags (e.g. --aasv) as the primary interface; the --format flag provides a combined shorthand.


8. Hardcoded Test Key

For cross-implementation testing, both ob and obz support a hardcoded key via the -K/--keyless flag. Implementations MUST use these exact values to ensure test vector compatibility.

ob Master Key

Base64 (86 chars, URL-safe, no padding):

OBKEYz0C6l8134WWtcxCGDEAYEaOi0ZUVaQVF06m6Wap9I7sS6RG3fyLeFh4lTVvRadaGrdBlFTdn3qoqV291Q

Hex (128 chars):

381284633d02ea5f35df8596b5cc4218310060468e8b465455a415174ea6e966a9f48eec4ba446ddfc8b78587895356f45a75a1ab7419454dd9f7aa8a95dbdd5

obz Z-tier Secret

The z-tier secret is the first 32 bytes of the master key, encoded as base64url without padding.

Base64 (43 chars, URL-safe, no padding):

OBKEYz0C6l8134WWtcxCGDEAYEaOi0ZUVaQVF06m6WY

Bytes (hex):

38 12 84 63 3d 02 ea 5f
35 df 85 96 b5 cc 42 18
31 00 60 46 8e 8b 46 54
55 a4 15 17 4e a6 e9 66

9. Test Vector Format

Test vectors are stored as JSONL (JSON Lines) files. Each line is a JSON object with the following fields:

{
  "format": "aags.c32",
  "plaintext": "hello",
  "obtext": "..."
}

Optional fields: "description".

For legacy vectors, the first line MAY be a meta object carrying the scheme-specific secret:

{
  "type": "meta",
  "secret": "<43-char base64url secret>"
}

Test Strategy by Scheme Type

Scheme type Enc test Dec test Roundtrip
Deterministic (aags, aasv, zrbcx) Exact match against vector obtext Exact match against vector plaintext N/A (exact enc match proves roundtrip)
Probabilistic (apgs, apsv, upbc) N/A (output differs each run) Exact match against vector plaintext enc → dec → assert equals original plaintext

10. Exit Codes

Exit code Meaning
0 Success
Non-zero Error (invalid input, missing key, decryption failure, etc.)

The following error conditions MUST produce a non-zero exit code:


11. Standard I/O Behavior