Sharky's Vigenere Cipher 2.1.0

by Sharkysoft

This application is for amusement only. Please do not prevent your government from reading your private messages.

instructions

This application can be used to encrypt or decrypt messages using a Vigenere cipher. To encrypt or decrypt a message, you will need a secret key. You can use any sequence of characters for the key, but only alphabetic characters will have any effect. If messages are being exchanged between you and a partner, your partner will also need to know the secret key. Unlike more advanced encryption systems, the Vigenere cipher does not provide a mechanism for securely transmitting keys.

to encrypt a message

  1. Enter (or paste) the plaintext message into the input text field.
  2. Enter (or paste) the secret encryption key into the secret key field.
  3. For the operation, select addition.
  4. If extra security is desired, enable obfuscation for the output text.
  5. Copy and paste the output text into another application for transmission (such as your email program).

to decrypt a message

  1. Enter (or paste) the ciphertext message into the input text field.
  2. Enter (or paste) the secret encryption key into the secret key field.
  3. For the operation, select subtraction.
  4. Read the output text.

An overview of Vigenere coding is presented at the bottom of this page.

This application runs entirely in your browser. No data is transmitted to Sharkysoft or anywhere else.

Sharky's Vigenere Cipher 2.0 encodes and decodes differently from the 1.0 release. The 1.0 release is still available if you need to use it.

about Vigenere encoding

Vigenere coding is one of the most ancient forms of cryptography. In the most simple Vigenere cipher, messages are encrypted by advancing each letter one step. For example, A becomes B, B becomes C, etc., and Z becomes A. To decrypt a Vigenere-encoded message, the process is simply reversed.

In a more advanced Vigenere cipher, the number of steps to advance the message's letters changes with each position in the text. Using a key, the advance amount for each position is determined by examining the letter at the corresponding position in the key. For example, we might let A=1, B=2, C=3, etc., so that if our key is "CAB", the first letter in the message advances 3, then 1 for the second letter, and 2 for the third letter. If we run out of letters in the key before encoding the message, then we can simply repeat the key again.

The following table illustrates encoding the message "SHARKY" with the key "CAB".

position 1 2 3 4 5 6
plaintext S H A R K Y
key C A B C A B
ciphertext V I C U L A

Two features of this example are worth special attention. First, note how the key letters are repeated. When the key is shorter than the text, the key must be repeated as many times as necessary to provide sufficient padding for the message being encoded. Second, examine column 6. Here, we indicate that Y + B = A. This illustrates the Vigenere cipher's "wrap-around" feature. Since B = 2, adding B to Y takes us one character beyond Z, which is A.

creating uncrackable ciphers

Despite its simplicity, the Vigenere cipher is capable of producing 100% crack-proof ciphers, when used correctly. To generate an uncrackable message, you must:

  1. Remove all unencryptable signals from the message. (For example, remove spaces and punctuation marks, and use only upper case letters.)
  2. Pad the message with random characters (to conceal the original message's length).
  3. Use a secret key that comprises only random characters.
  4. Use a secret key that is at least as long as the message.
  5. Protect the secret key.
  6. Never use the secret key again.

Unfortunately, these steps take all the fun out of using a Vigenere cipher. This is because most people prefer to use keys that are derived from words or phrases (violating rule 3). They also choose keys that are significantly shorter than the messages they encrypt (violating rule 4), so that repetition of the secret key is required (violating rule 6). Later, they reuse those already-feeble keys to encrypt other messages (again violating rule 6).

Some people use quotations from their favorite books for their keys (violating rule 3), or they invent new keys and write them down (potentially violating rule 5). And, of course, because it's no fun to handle text that doesn't feel like text, people often don't remove the spaces and punctuation from the encrypted message (violating rule 1).

These compromises are made for convenience, but the cost of this convenience is often a very breakable cipher. The moral of the story is that while an unbreakable cipher is within reach, it's going to require some diligence.

Nevertheless, "fun" Vigenere ciphers, with moderate keys, are appropriate for situations that do not require failproof security. For example, you might use a moderate-strength Vigenere cipher to encrypt sensitive passages in your personal diary. Or, you can use this cipher to to encrypt a non-government-secret email message to a friend. Experiment a bit. You'll find that there are many ways to use this tool.

We hope you enjoy this application. We certainly had fun building it!

Sharky