How do I implement an Autokey Vigenere cipher in C++? For those of you who don't know, a Vigenere cipher is a cipher consiting of a 26x26 table of letters; Since I can't describe it, here's a file with the table in it. Anyway it was created by Blaise de Vigenere in the late 1700s. Actually, he created to ciphers that were very similiar: a standard cipher and an autokey cipher; the autokey simply appends the cleartext to the key, making the key as long or longer than the message. You use it by finding the letter of the message in the collum and the letter of the key in the rows, then you find where they intersect, which is the ciphertext letter; repeat for the entire length of the key; if the key is longer than the cleartext, add nulls[garbage] to the cleartext, making it as long as the key. There are four modes: standard, progressive, autokey, and one-time pad[OTP].Selecting a key for an OTP is simple, just follow four simple rules: 1. The key MUST be COMPLETLY RANDOM AND UNPREDICTABLE. 2.T he key MUST NEVER be used AGAIN. EVER. 3. The key MUST be as long as the message. 4. The key MUST be DESTROYED after use, preventing it from falling into the wrong hands or reused. They OTP fis the ONLY unbreakable cipher, because a brute force attack won't work, because for every possiblity for the key, you get every possiblity for the cleartext. For example, TAEKA, decrypted with QWERT would yeild DEATH, but decrypted with another key, it might yeild BLOOD.I've already explained how the autokey works. In standard mode, just repeat the key the entire length of the message. In progressive, do the same, just shift each letter of the key by one on the first repeat. Here are some examples:
Note: For this example, for the sake of simplicity, I simple used the arrangement of my keyboard for the key. In pratice, the key should be MUCH more random than this, preferably generated by a cryptographic hardware RNG.
There's also a fifth version, which uses emerging ciphertext as the key, but that is far too complex. Can you help me with this program? As you can see, I know how it works, I just don't know how to implement it in C++.
Last edited by Apollyon; January 7th, 2005 at 11:58 AM.
The nerds will rule over the common folk. The geeks will rule over the nerds. The supergeeks will rule over the geeks. The hackers will rule over the supergeeks. The superhackers will rule over the hackers. Mwhahaha; I'll rule you all!!!