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
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!


Thanks to your feedback and relevant comments, dCode has developed the best 'Base45 Encoding' tool, so feel free to write! Thank you!

Base45 Encoding

Base45 Decoder










See also: Base64 CodingBase32QR Code

Base45 Encoder


Loading...
(if this message do not disappear, try to refresh this page)

Answers to Questions (FAQ)

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 online "Base45 Encoding" source code. Except explicit open source licence (indicated CC / Creative Commons / free), the "Base45 Encoding" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, 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, copy-paste, or API access for "Base45 Encoding" are not public, same for offline use on PC, tablet, iPhone or Android ! Remainder : dCode is free to use.

Need Help ?

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

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developed the best 'Base45 Encoding' tool, so feel free to write! Thank you!


Source : https://www.dcode.fr/base45-encoding
© 2021 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
Feedback