Back to Cosmos

Bacon's Cipher

code/cryptography/src/baconian_cipher/README.md

latest1.8 KB
Original Source

Bacon's Cipher

Bacon's cipher (or Baconian cipher) is actually a form of steganography rather than a cipher. This means that it's a method to hide a message in plain sight. It works by utilizing two different typefaces. One would be 'A', the other 'B'. You then write some text using both typefaces mixed together, following a simple pattern corresponding to each letter of the message you want to hide:

LetterCodeLetterCode
AaaaaaNabbab
BaaaabOabbba
CaaabaPabbbb
DaaabbQbaaaa
EaabaaRbaaab
FaababSbaaba
GaabbaTbaabb
HaabbbUbabaa
IabaaaVbabab
JabaabWbabba
KababaXbabbb
LababbYbbaaa
MabbaaZbbaab

* There is also another version of this cipher where I and J, and U and V correspond to the same code. This version, where each letter has it's own distinct code, is more popular and is generally the one used in implementations.

For example, "Hello world" would become "AABBBAABAAABABBABABBABBBABABBAABBBABAAABABABBAAABB" (spaces are ignored). If we wanted to hide this in some Lorem Ipsum, making typeface A normal and typeface B bold, it would look like the following:

Lorem ipsum dolor sit amet consectetur adipiscing elit sed

Sources and more detailed information:


<p align="center"> A massive collaborative effort by <a href="https://github.com/OpenGenus/cosmos">OpenGenus Foundation</a> </p>