# Bacon Cipher: Encrypt and Decrypt Online

Bacon’s cipher or the Baconian cipher is a method of steganography (a method of hiding a secret message as opposed to just a cipher) invented by Francis Bacon in 1605.

A message is concealed in the presentation of text, rather than its content.

The Bacon cipher is a substitution cipher in which each letter is replaced by a sequence of 5 characters.

In the original cipher, these were sequences of A’s and B’s.

For example, the letter D was replaced by AAABB, the letter O was replaced by ABBAB and so on.

Each letter is assigned to a string of five binary digits. These could be the letters A and B, the numbers 0 and 1 or whatever else you may prefer.

## Types of Bacon Cipher

First, **the 24-letter cipher**: In which 2 pairs of letters (I, J) and (U, V) have same ciphertexts.

Letter |
Bacon Code |
Binary Code |

A |
AAAAA |
00000 |

B |
AAAAB |
00001 |

C |
AAABA |
00010 |

D |
AAABB |
00011 |

E |
AABAA |
00100 |

F |
AABAB |
00101 |

G |
AABBA |
00110 |

H |
AABBB |
00111 |

I, J |
ABBBB |
01000 |

K |
ABAAB |
01001 |

L |
ABBAB |
01010 |

M |
ABABB |
01011 |

N |
ABBAA |
01100 |

O |
ABBAB |
01101 |

P |
ABBBA |
01110 |

Q |
ABBBB |
01111 |

R |
BAAAA |
10000 |

S |
BAAAB |
10001 |

T |
BAABA |
10010 |

U, V |
BAABB |
10011 |

W |
BABAA |
10100 |

X |
BABAB |
10101 |

Y |
BABBA |
10110 |

Z |
BABBB |
10111 |

Second, **the 26-letter cipher**: In which all letters have unique ciphertexts.

Letter |
Bacon Code |
Binary Code |

A |
AAAAA |
00000 |

B |
AAAAB |
00001 |

C |
AAABA |
00010 |

D |
AAABB |
00011 |

E |
AABAA |
00100 |

F |
AABAB |
00101 |

G |
AABBA |
00110 |

H |
AABBB |
00111 |

I |
ABAAA |
01000 |

J |
ABAAB |
01001 |

K |
ABABA |
01010 |

L |
ABABB |
01011 |

M |
ABBAA |
01100 |

N |
ABBAB |
01101 |

O |
ABBBA |
01110 |

P |
ABBBB |
01111 |

Q |
BAAAA |
10000 |

R |
BAAAB |
10001 |

S |
BAABA |
10010 |

T |
BAABB |
10011 |

U |
BABAA |
10100 |

V |
BABAB |
10101 |

W |
BABBA |
10110 |

X |
BABBB |
10111 |

Y |
BBAAA |
11000 |

Z |
BBAAB |
11001 |

## Example

## How to encrypt using the Bacon cipher

To encode the message, “Attack now”, we replace each letter. In this example we are using the 24-letter cipher variant.

Plaintext Letter |
Baconian Ciphertext |

A |
AAAAA |

T |
BAABA |

T |
BAABA |

A |
AAAAA |

C |
AAABA |

K |
ABAAB |

N |
ABBAA |

O |
ABBAB |

W |
BABAA |

Thus, “Attack now” is encrypted as: AAAAA BAABA BAABA AAAAA AAABA ABAAB ABBAA ABBAB BABAA.

## How to decrypt Bacon cipher

Baconian decryption is a substitution with the biliteral alphabet of Bacon.

Use the above Bacon cipher decoder and encoder to encrypt/decrypt simple messages.

## How to recognize a Bacon ciphertext

The encoded message is a biliteral code (binary with 2 letters), and maybe spaces every 5 characters.

## What are the variants of the Bacon cipher?

The letters A and B can be replaced by other characters, such as 0 and 1, to transform the message into binary format.