What is a Base32?
Base32 is a variant of Base64 which uses letters and numbers
from 2 to 7 (and =) as basic symbols.
How to encrypt using Base32 Cipher?
The Base32 code is described in RFC 4648 standard. It allows to
encode with 32 characters:
- ABCDEFGHIJKLMNOPQRSTUVWXYZ234567 and the = symbol optionally
used as the final character (as in Base64).
- The message to be encoded is first treated as a binary string
(according to a predefined encoding such as ASCII or Unicode).
Example: Base is encoded in ASCII (8-bit)
The string is then split
every 5 bits, and optionally completed with 0s.
Example: The split gives the 32 bits
01000,01001,10000,10111,00110,11001,01 (three 0 needed at the
Each 5-tuple is then encoded in base 32 by the letter or the
corresponding number according to the conversion table:
Example: 01000 for I, 01001 for J, and so on. Until IJQXGZI
The standard indicates that the Base32 message must have a number
of characters multiple of 8. The message obtained must therefore
be completed with the character = (padding char).
Example: Finally, the message Base is base32-encoded IJQXGZI=
How to decrypt Base32 Cipher?
The Base32 decoding is similar to a mathematical base change.
Example: Decode the message INXWIZI= coded in Base 32
the final = of the encoded message.
Example: INXWIZI= becomes INXWIZI
Replace each character
with its 5-bit value (cf conversion table) to create a binary
Example: I for 01000, N for 01101, etc. Until
Read the binary
string according to the encoding used (ASCII, Unicode, etc.)
Example: The message is divided into bytes (8-bits) as follows:
01000011,01101111,01100100,01100101 (the last string composed of
0 is ignored), which corresponds to ASCII (or Unicode) string
How to recognize a Base32 Ciphertext?
A B32-encoded message
- is composed only of the characters
'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567 =' (no 0,1,8,9)
- theoretically has a number of character multiple of 8
- ends with 0,1,3,4 or 6 characters = (equal).
- has a length greater than 40 to 60% of the original message
Why aren't digit 0 and 1 used in Base32?
The digit 0 is avoided not to be confused with the letter O,
and the number 1 is also avoided for its resemblance to the
What are the variants of the Base32 encoding?
Base32 is similar to the Base64 which is much more commmonly
The z-base-32 code is a variant improved for reading and
writing by men.
The mathematical basis 32 (or base32hex) is the most natural
version for writing numbers in base 32 and uses the symbols