Encodings

Base85

Binary-to-text encodings: hex, Base32, Base58, Base64, Base85 and relatives

unverified Root API only Not cryptographic
Unverified tier.

Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About Base85

Base85 is one of 25 Base-N encodings variants in the NextSSL registry, a binary-to-text encoding. Its registry entry cites RFC 1924. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

Overview

Base-N encodings represent arbitrary binary data using a restricted alphabet of printable characters so it can travel through text-only channels such as email, URLs, JSON or DNS. They are reversible transformations, not encryption, and provide no security or confidentiality.

An encoding groups input bits and maps each group to a symbol. Base16 (hex) maps 4 bits to one of 16 characters. Base32 maps 5 bits, and Base64 maps 6 bits, with '=' padding to complete the last group. Base85 and Ascii85 map 4 bytes to 5 characters for denser output. Base58, used for Bitcoin addresses, treats the whole input as a big integer and removes visually ambiguous characters such as 0, O, I and l; Base58Check adds a SHA-256-based checksum.

NextSSL includes over twenty variants: hex/Base16; Base32 with the RFC 4648 standard, extended-hex, z-base-32, DNSCurve and DNSSEC (RFC 5155) alphabets; Base64 in standard, URL-safe, unpadded, MIME, IMAP modified-UTF-7, bcrypt, crypt(3) and BinHex alphabets; Base58 with Bitcoin, Flickr and Ripple alphabets and Base58Check; Base45 (RFC 9285); Ascii85, Base85 (RFC 1924) and Z85; and basE91.

Different alphabets exist because each target channel forbids different characters: URL-safe Base64 replaces '+' and '/', and Base45 is designed to fit QR-code alphanumeric mode. Variants also differ in padding, line wrapping and case rules, so decoders must be configured for the exact flavour expected. Base64 is the most widely used, while hex is simplest to read.

History

2006–2022
  1. Specified in RFC 4648 section 8

  2. Specified in RFC 4648 section 6

  3. Specified in RFC 4648 section 7

  4. Specified in RFC 4648

  5. Specified in RFC 5155 section 3.3

  6. Specified in RFC 9285

Security notes

Encodings provide no security: anyone can decode them. Base58Check's checksum detects typing errors but not deliberate changes. Decoders must reject non-canonical input where uniqueness matters, such as in signatures.

Typical uses

Embedding binary in JSON, URLs and emailDisplaying keys, hashes and addressesPEM and data URIsQR codes (Base45)

Sizes

The registry declares no fixed sizes for this algorithm.

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'unverified' is reachable from the root API only
text = root.call("encode_with", "base85", None, b"hello")[0]
data = root.call("decode_with", "base85", None, text)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Base85?

Base85 is an encoding in the Base-N encodings family. Base-N encodings represent arbitrary binary data using a restricted alphabet of printable characters so it can travel through text-only channels such as email, URLs, JSON or DNS.

Who designed Base85 and when?

Base85 belongs to the Base-N encodings family, first published in 2006 by Simon Josefsson (editor). Its origin: RFC 4648 and related specifications.

Which standards define Base85?

Base85 is referenced by RFC 1924.

Is Base85 safe to use?

Base85 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).

What other Base-N encodings variants are there?

NextSSL also registers ascii85, base16, base32, base32-dnscurve, base32-dnssec, base32hex and more in the Base-N encodings family.