| Internet-Draft | XB64 Reversible Obfuscation | November 2026 |
| Harano | Expires 19 May 2027 | [Page] |
This document specifies XB64 (XORed Base64), a lightweight reversible obfuscation encoding scheme for situations where immediate readability of source data is undesirable but cryptographic confidentiality is not required.¶
To provide a key-dependent yet fully reversible representation, XB64 applies repeating-key XOR to arbitrary octet sequences and encodes the result as printable ASCII text using Base64 as specified in RFC 4648. The resulting text itself preserves the source information, allowing exact reconstruction with the same key without external data lookup, while remaining suitable for human handling and exchange through text-oriented systems.¶
By specifying a common encoding format for this level of obfuscation, this document aims to enable interoperable use across different applications, platforms, and implementations.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 19 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
Some applications need to avoid immediately exposing source data without requiring cryptographic confidentiality. XB64 provides a lightweight, reversible obfuscation mechanism for this purpose.¶
XB64 applies repeating-key XOR to arbitrary source octets and represents the result as printable ASCII text using Base64 as specified in Sections 3 and 4 of [RFC4648].¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Each source octet is XORed with the corresponding key octet. The key is applied cyclically as necessary.¶
For each source index i, where 0 <= i < n, and m > 0:¶
T[i] = S[i] XOR K[i mod m]¶
where:¶
S[i] = source octet at index i K[j] = key octet at index j (0 <= j < m) T[i] = transformed octet at index i n = source length m = key length¶
The decoding operation accepts:¶
Using the same key octets as those supplied during encoding guarantees reconstruction of the original source.¶
When a key is supplied as text, the conversion rules of Section 6 apply.¶
The encoded text is decoded using Base64 to obtain the transformed octet sequence T.¶
Decoders MAY accept non-conforming Base64 input. The handling of such input is implementation-defined.¶
The decoder applies the XOR transformation defined in Section 3.2 to the decoded octet sequence T using the supplied key K.¶
Because XOR is self-inverse, this operation reconstructs the original source octet sequence S.¶
The complete decoding process can be expressed as:¶
XB64_Decode(E, K) = XOR_Transform(Base64_Decode(E), K)¶
For any source S and key K:¶
XB64_Decode(XB64_Encode(S, K), K) = S¶
The equality holds for arbitrary source octet sequences, including empty sequences and non-textual binary data.¶
If the source S is empty, encoding produces an empty string regardless of the key K.¶
If the key K is empty, the XOR transformation is bypassed during both encoding and decoding. The encoded result is the ordinary Base64 representation of S.¶
If the key is longer than the source, the unused portion has no effect on the result.¶
For a source of n octets, keys of length at least n that share the same first n octets produce identical encoded results, regardless of their remaining octets.¶
The XB64 transformation uses an octet sequence as its key.¶
Textual keys are recommended for ease of handling and exchange. ASCII-only textual keys are preferred for interoperability and SHOULD be represented by their corresponding ASCII octet values.¶
For textual keys containing non-ASCII characters, UTF-8 [RFC3629] SHOULD be used to convert the text to octets. Other character encodings MAY be used.¶
Keys MAY also be supplied directly as arbitrary octet sequences.¶
This section provides test vectors for independent implementations.¶
Unless otherwise indicated, source and key values are represented as hexadecimal octets.¶
The ASCII text descriptions are illustrative. The XB64 transformation treats source data as an octet sequence without interpreting it as text, regardless of whether the source data is textual or binary.¶
The following examples can be used to verify both encoding and decoding using the specified keys.¶
ASCII text "abc" using the key "xyz":¶
Source: 61 62 63 Key: 78 79 7A XOR: 19 1B 19 Encoded: GRsZ¶
ASCII text "abcde" using the key "xyz":¶
Source: 61 62 63 64 65 Key: 78 79 7A XOR: 19 1B 19 1C 1C Encoded: GRsZHBw=¶
ASCII text "ab" using the key "xyz":¶
Source: 61 62 Key: 78 79 7A XOR: 19 1B Encoded: GRs=¶
An empty source using the key "xyz":¶
Source: (empty) Key: 78 79 7A Encoded: (empty)¶
XB64 is a reversible obfuscation encoding scheme intended to reduce the immediate readability of source data. It is not an encryption mechanism and does not provide confidentiality.¶
XB64-encoded data MUST NOT be treated as encrypted or used as a substitute for cryptographic protection when confidentiality of the source data is required.¶
The XB64 key is not a cryptographic key, but a parameter used for the reversible XOR transformation.¶
The key may be kept separate from the encoded data to increase the effort required for recovery, or disclosed alongside it when immediate readability is undesirable but convenient recovery is preferred. Keeping the key undisclosed does not guarantee confidentiality.¶
When a source octet and its corresponding transformed octet are known, the applied key octet can be recovered through XOR. Because the key is repeated cyclically, recovered key octets can also be used to recover source octets at other positions.¶
When source octets are zero, the corresponding transformed octets directly reveal the applied key octets. Conversely, when applied key octets are zero, the corresponding source octets remain unchanged in the transformed data.¶
This document does not require any IANA actions.¶