Cryptography - Base64 Cipher

Card Puncher Data Processing


Base64 is a cipher (without key and reversible) that converts (encode) a data (message) in 64 characters of the ASCII string.

Decoder / Encoder

See also the Google encoder/decoder


  • datastore accept only ASCII string format
  • to have a portable version of the data between system. ie get rid of:
  • having data encoded on only 64 characters (ie without the point for instance)



A text message with only string

  • Transform the text into binary data by applying the character set table conversion
  • Transform the binary into a succession of characters with the alphabet conversion table
  • add the optional trailing character =
  • and you get the base64 cipher




  • base64Conversion is the conversion when the alphabet conversion is applied
  • = is one or several optional trailing character


The alphabet is the conversion table between:

base64url (base64 for URL) replaces:

  • the + with -
  • and / with _

because + and / are characters that have meaning in a URL

Binary Number Base 64 Number Character Base64 Character Base64Url
0000 0 A A
0001 1 B B
0010 2 C C
0011 3 D D
0100 4 E E
0101 5 F F
0110 6 G G
0111 7 H H
1000 8 I I
1001 9 J J
1010 10 K K
11 L L
12 M M
13 N N
14 O O
15 P P
16 Q Q
17 R R
18 S S
19 T T
20 U U
21 V V
22 W W
23 X X
24 Y Y
25 Z Z
26 a a
27 b b
28 c c
29 d d
30 e e
31 f f
32 g g
33 h h
34 i i
35 j j
36 k k
37 l l
38 m m
39 n n
40 o o
41 p p
42 q q
43 r r
44 s s
45 t t
46 u u
47 v v
48 w w
49 x x
50 y y
51 z z
52 0 0
53 1 1
54 2 2
55 3 3
56 4 4
57 5 5
58 6 6
59 7 7
60 8 8
61 9 9
62 + -
0011 1111 63 / _



With atob / btoa Javascript Function, see the decoder/encoder script above.


base64 utility

cat my-file | base64

Open Ssl

Openssl (libcrypto)

echo Hello World ! | openssl base64


String encode = Base64.getEncoder().encodeToString("Foo".getBytes());
byte[] decode = Base64.getDecoder().decode(encode);
System.out.println(new String(decode,StandardCharsets.UTF_8));

Documentation / Reference

  • rfc4648 - The Base16, Base32, and Base64 Data Encodings

Recommended Pages
Card Puncher Data Processing
Ant - Mail

How to send a mail with Ant. The jar file mail.jar () must be in the lib dir of ant. where: the user and the password must be in clear text...
Soap Ui Basic Authentication
Authentication - Basic Authentication (HTTP)

Basic Access Authentication is an Authentication mechanism from HTTP auth. Basic access authentication uses the easily reversible Base64 encoding making it non-secure unless used in conjunction with TLS....
Card Puncher Data Processing
Authentication - HTTP Digest Access Authentication

Digest access authentication is an http authentication method based on authorization entry. It is intended (as a security trade-off) to replace unencrypted HTTP basic access authentication. It is not,...
Jwt Auth Flow
Authentication - Jwt (Json web token)

Authentication - Jwt (Json web token) json web token is a token protocol. It's also known as jot. The main purpose of JWTs is to transfer (ie identity property) between two parties This is a simple,...
Strip Le Mot D Epasse Du Noob
Authentication - Password

Authentication - Password Password credentials (i.e., username and password) is something you know and is therefore a group identifier. ionicasmeets/status/954269521531035648Ionica Smeets Password...
Cpu Moore Law Transistor
Bit - Binary Data (Structure)

Binary Data is a computer file that contains binary data (0 or 1) Binary data may be described: at the bit level (base 2) at the byte level (base 2 - 8 bit) at the hexadecimal level (base 16)...
Card Puncher Data Processing
Cryptography - Algorithm (called a Cipher)

A cipher is an algorithm that encrypt a plain text message into a ciphertext. Cipher algorithm can be categorized by the key that they used as parameters. No key symmetric one (using one key) ...
Card Puncher Data Processing
Cryptography - Encryption (Enciphering)

Encryption is the function of a cipher that transforms usable data into an unreadable form. It provides confidentiality if a secret is used in the encryption. There is two class of encryption. ...
Card Puncher Data Processing
Cryptography - Key

A key is a parameter used in a cipher algorithm that determines the encryption operation (forward) and the decryption operation (backward). It's the only secret parameter that protect the anonymity...
Card Puncher Data Processing
Cryptography - PKCS (Public Key Cryptography Standards)

PKCS #X (Public Key Cryptography Standards) are a group of public-key cryptography standards devised and published by RSA Security Inc, starting in the early 1990s. They defined the file format of key...

Share this page:
Follow us:
Task Runner