← Cryptography guide

K092 / Encoding and decoding

Quoted-Printable

Quoted-Printable MIME · Survey date 2026-12-05

A MIME transfer encoding that keeps predominantly ASCII data human-readable.

CRYPTOGRAPHY LAB / K092

Cryptography Lab · Quoted-Printable

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

Quoted-Printable (octet demo)

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

Reference ↗

Open lab →

Definition and overview
A MIME transfer encoding that keeps predominantly ASCII data human-readable. Source document ↗
Classification and reversibility
Reversible MIME transfer encoding decoded by the receiver. Source document ↗
Key or secret requirements
Not confirmed in the survey
Operating principle and structure
Represent nonprinting/special octets as =XX and leave permitted ASCII unchanged. Source document ↗
Key size, block size and parameters
76 characters per line, excluding CRLF but including equals signs. Source document ↗
Security strength and recommendation
Not confirmed in the survey
Known attacks and vulnerabilities
Some QP decoders have had heap out-of-bounds read vulnerabilities. Source document ↗
Standards and certification
RFC 2045 section 6.7 MIME standard. Source document ↗
Typical uses
Raw email Content-Transfer-Encoding header. Source document ↗
Implementations, libraries and tools
Python quopri and other MIME QP encoders/decoders. Source document ↗
Decryption or decoding
Decode =XX and soft line breaks to recover original bytes. Source document ↗
Advantages
Efficient for mostly ASCII text with few special characters. Source document ↗
Limitations and cautions
Space-inefficient for binary; Base64 is recommended. Source document ↗
Distinguishing encryption, encoding and hashing
Transfer encoding only, not encryption or hashing, and provides no confidentiality. Source document ↗

Practical examples

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

Example

Most ASCII characters remain unchanged; special characters and end-of-line spaces become =XX. The receiver interprets =XX and soft line breaks to restore bytes.

Procedure

Keep permitted bytes, encode required octets as =XX, preserve trailing spaces/tabs as =20/=09 and insert soft breaks within the 76-character limit. Decode =XX and remove soft breaks. No key is involved.

Scenario

Use QP as Content-Transfer-Encoding for mostly ASCII email bodies with occasional special characters; decode for display. Binary attachments typically use Base64.

Pitfalls and alternatives

Prefer Base64 for binary or predominantly non-ASCII text. Watch trailing whitespace, equals signs, lowercase hex, missing soft breaks and decoder bounds checks. Not confidentiality or integrity protection.

References