Last modified on February 16, 2013, at 12:16

NATO 5-gram decoding

OTP Decoding By Hand - A How-To

Quick History With OTP encryption

One time pad (OTP), also called Vernam-cipher or the perfect cipher, is a crypto algorithm where plaintext is combined with a random key. It is the only known method to perform mathematically unbreakable encryption. Used by Special Operations teams and resistance groups in WW2, popular with intelligence agencies and their spies during the Cold War and beyond, protecting diplomatic and military communications around the world for many decades, the one-time pad gained a reputation as a simple yet solid encryption system with an absolute security which is unmatched by today's modern crypto algorithms. Whatever technological progress may come in the future, one-time pad encryption is, and will remain, the only system to provide real long-term message security. We can only talk about one-time pad if some important rules are followed. If these rules are applied correctly, the one-time pad can be proven unbreakable Even infinite computational power and infinite time cannot break one-time pad encryption, simply because it is mathematically impossible. However, if only one of these rules is disregarded, the cipher is no longer unbreakable.

Rules Of Thumb for an unbreakable OTP Encryption

-The key is at least as long as the message or data that must be encrypted.

-The key is truly random (not generated by a simple computer function or such)

-Key and plaintext are calculated modulo 10 (digits), modulo 26 (letters) or modulo 2 (binary)

-Each key is used only once, and both sender and receiver must destroy their key after use.

-There should only be two copies of the key: one for the sender and one for the receiver (some exceptions exist for multiple receivers)

The How-To

Now, for this example i am going to be working with the original OTP code {encrypted} :


Now to decode any good OTPE such as this one, we will need a KEY. This key can be downloaded here:

Assuming you know how to extract the iso, go ahead and open p1.txt (you cannot use notepad unless you want your computer to freeze, maybe even crash, you must use a special program to handle large amounts of text like this)

Now after opening p1.txt using your Large-Text notepad, go ahead and open your normal notepad and post the code you are trying to decode on it. (this is only to make things easier.)

Now you have your key (p1) opened on one side and your OTPE on your other.

To Decrypt we are going to use what i call the "CTRL+F" method

Go to your "LARGE TEXT" notepad (referred as "LTN" from now on) and use the Search button. (this might be found by going into tools- search, or CTRL+F)

Look over at your notepad and type in the first 5 letter grouping into the search, and press "Search"

Now your LTN will search for the first "word". (5 letter sequence such as "AFZKZ") Now as i am sure as you have already noticed, your LTN has two "rows" of text, with two "words" per row. when you press search, you want the highlighted word to be on the RIGHT. if your "word" comes up, but it is on the left, then simply press "find" again, until the highlighted word appears on the right column.

Now, to the Left of the highlighted word will be the first 5 letter sequence of your code.(Providing you are using the right key) In this case it will be "PAYLO".

Repeat this process until all "words" are decoded!!!

You should come out with something like this:


Now, as listed up top, rule #1 of OTPE is that the message must hold as many characters as the encrypted message. Remembering that, we consider the "X's" Fillers. remove them to clean up your message a little. (UNLESS the "X" is part of the message, you will have to use common sense for that :D)

Remove and add spaces where appropriate, and VOILA! your first OTP decryption!!!

Good LTE:

Source Intro:

Decoder program

A program and source-code for decoding OTP22 NATO Messages in 5-gram (5-letter) format is available at: