← Cryptography guide

K086 / Encoding and decoding

Ascii85 Base85

Ascii85 Base85 · Survey date 2026-12-05

Ascii85 (Base85) is a binary-to-text encoding representing binary data as text.

CRYPTOGRAPHY LAB / K086

Cryptography Lab · Ascii85 Base85

Run real computations and inspect intermediate states step by step.

Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.

Scope: Limited implementation

Ascii85 (no framing)

See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.

Open lab →

Definition and overview
Ascii85 (Base85) is a binary-to-text encoding representing binary data as text. Source document ↗
Classification and reversibility
Reversible encoding, not modern cryptography; anyone who knows the format can decode it. Source document ↗
Key or secret requirements
No secret key is required. Source document ↗
Operating principle and structure
Reads four bytes as a big-endian 32-bit integer and converts it to five base-85 digits. Source document ↗
Key size, block size and parameters
Four bytes produce five characters; a tail of r bytes produces r+1 characters; a z abbreviation exists. Source document ↗
Security strength and recommendation
Not confirmed in the survey
Known attacks and vulnerabilities
Not confirmed in the survey
Standards and certification
Base85 is not a single standard; implementations and variants differ. Source document ↗
Typical uses
Adobe PostScript/PDF and Git binary patches. Source document ↗
Implementations, libraries and tools
Python base64 module a85encode/b85encode and other implementations. Source document ↗
Decryption or decoding
Decoders can restore original bytes with or without Adobe-style <~ ~> framing. Source document ↗
Advantages
More space-efficient than Base64/uuencode (four bytes to five characters). Source document ↗
Limitations and cautions
May be safe for 7-bit MIME but not for URLs, SGML or HTTP cookies. Source document ↗
Distinguishing encryption, encoding and hashing
Do not mistake encoding for confidentiality protection. Source document ↗

Practical examples

Examples are illustrative; they are not execution-tested implementations or operational recommendations.

Example

Split binary into four-byte blocks and convert each into five characters. Pad the final one to three bytes and retain only the necessary characters. Optionally add <~ ... ~> framing for PDF/PostScript. No key or secret is used.

Procedure

Encode: group four bytes, interpret as a big-endian integer, convert to five base-85 characters, apply variant rules such as z for zero blocks, pad/truncate the tail and apply framing/line breaks. Decode: check framing and whitespace rules, reverse five characters to four bytes and restore the tail length. No secret key is needed.

Scenario

Embed binary data in PDF/PostScript or represent Git binary patches as text. Encrypt first if confidential binary must travel through a text channel.

Pitfalls and alternatives

Not for confidentiality; escaping can make it unsuitable for URLs, SGML and cookies. Do not mix Ascii85, Z85, RFC1924 or Git variants. Encrypt sensitive data with authenticated encryption such as AES-GCM first.

References