Search for a tool
Base45 Encoding

Tool for coding with Base45 encoding, using 45 ASCII characters, which has become known since its use in the European green pass/certificate.

Results

Base45 Encoding -

Tag(s) : Character Encoding

Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Feedback and suggestions are welcome so that dCode offers the best 'Base45 Encoding' tool for free! Thank you!

Base45 Encoding

Base45 Decoder

 Results format ASCII (printable) characters Hexadecimal 00-7F-FF Decimal 0-127-255 Octal 000-177-377 Binary 00000000-11111111 Integer number File to download

Base45 Encoder

What is Base-45? (Definition)

Base-45 is a proposed encoding standard for encoding data with 45 characters. It has been proposed by Faltstrom, et al. as a compact encoding better suited than Base32 or Base64 for QR-codes.

How to encrypt using Base-45 cipher?

The Base45 encoding consists in writing the data in base 45 and using the following list of symbols 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./: Which corresponds to the 45 characters that can be used in a QR-code in alphanumeric mode so the correspondance table IndexCharacter Base45 0 0 11 22 33 44 55 66 77 88 99 10A 11B 12C 13D 14E 15F 16G 17H 18I 19J 20K 21L 22M 23N 24O 25P 26Q 27R 28S 29T 30U 31V 32W 33X 34Y 35Z 36 37$
38%
39*
40+
41-
42.
43/
44:

Encoding begins by cutting the data to be encoded from left to right in groups of 2 bytes. If the data has an odd number of bytes, the last group is 1 byte in size.

Example: Encode the 3 characters B45, of ASCII code [66,52,53], which are then split [66,52],[53]

Each pair of 2 bytes $[a, b]$ is interpreted as a number in base $256$ such that $n = (a \times 256) + b$ (in base 10) which can then be converted into base 45 via a triple $[c,d,e]$ such that $n = c + (d \times 45) + (e \times 45^2)$. The characters in the correspondence table for the values '[c, d, e]' are noted (in that order) as encoded text.

Any last single byte $a$ at the end of the data is also interpreted as a number in base 256 and converted to a pair $[b,c]$ such that $a = b + (45 \times c)$. The characters in the correspondence table for the values [b,c] are noted (in that order) as encoded text.

Example: The couple [66,52] corresponds to the number 66 * 256 + 52 = 16948 and 16948 = 28 + 16 * 45 + 8 * 45 ^ 2, so the triplet [28,16,8] that is equivalent to the characters S,G,8 in base45
The remaining byte [53] is written in base 45 as follows: 53 = 1 * 45 + 8, either the pair [1,8] or the characters 1,8 in base45. The full encoding of B45 in base45 is SG881

How to decrypt Base-45 cipher?

For any string written in Base45, start by converting the characters into numeric values (according to the correspondence table).

Example: Decode SG881, or the values [28,16,8,8,1]

Divide the values into groups of 3, from left to right. If the last group of 3 is not complete, add zeros 0 at the end.

Example: [28,16,8,8,1] splits as [28,16,8],[8,1,0]

Interpret each group [c,d,e] as a number in base 45 as follows: $n = c + (d \times 45) + (e \times 45^2)$ and note the values $n$ obtained

Example: [28,16,8],[8,1,0] is converted to [16948],[53]

Convert each number to base 256 (so in bytes)

Example: 16948 = 66 * 256 + 52 or [66,52] and 53 remains [53] in base 256

The decoded message is the set of bytes. It can be interpreted in ASCII code (or Unicode)

Example: [66,52,53] for the 3 ASCII characters B,4,5 (plaintext)

How to recognize a Base-45 ciphertext? (Identification)

Base-45 uses the 36 uppercase alphanumeric characters 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ completed with the characters (space)', \$ (dollar), % (percent), * (asterisk), + (plus), - (minus/dash), . (period), / (slash) and : (colon).

Base-45 is optimized to transmit data with the alphanumeric mode of QR-codes.

It has been used in COVID-19 vaccines certificates and European Union green passes.

Source code

dCode retains ownership of the "Base45 Encoding" source code. Except explicit open source licence (indicated Creative Commons / free), the "Base45 Encoding" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Base45 Encoding" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Base45 Encoding" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.

Cite dCode

The copy-paste of the page "Base45 Encoding" or any of its results, is allowed (even for commercial purposes) as long as you cite dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Base45 Encoding on dCode.fr [online website], retrieved on 2023-12-03, https://www.dcode.fr/base45-encoding

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!