Questions tagged [vigenere]

Vigenère cipher is an encryption algorithm developed in 1553 and was considered uncrackable until the middle of the 19th century.

Application:

In order to encrypt text, you need to choose a word, W, and the encryption table.

Now, you encrypt the mth letter in the text you want to encrypt using a letter from the word W that was chosen before according to the following formula:

Em = L(m % n)

where:
m — the serial number of the letter n the text
Em — the letter for the m letter in the text
n — the length of w
L — the letter in w in the specified index.

Now, in the encryption table you go to (Em,Tm) (Tm is the m letter you encrypt), and write the letter that's written there, instead of the original letter.

The encryption table

 |a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|
------------------------------------------------------
a|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|
------------------------------------------------------
b|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|
------------------------------------------------------
c|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|
------------------------------------------------------
d|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|
------------------------------------------------------
e|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|
------------------------------------------------------
f|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|
------------------------------------------------------
g|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|
------------------------------------------------------
h|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|
------------------------------------------------------
i|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|
------------------------------------------------------
j|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|
------------------------------------------------------
k|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|
------------------------------------------------------
l|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|
------------------------------------------------------
m|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|
------------------------------------------------------
n|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|
------------------------------------------------------
o|o|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|
------------------------------------------------------
p|p|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|
------------------------------------------------------
q|q|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|
------------------------------------------------------
r|r|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|
------------------------------------------------------
s|s|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|
------------------------------------------------------
t|t|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|
------------------------------------------------------
u|u|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|
------------------------------------------------------
v|v|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|
------------------------------------------------------
w|w|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|
------------------------------------------------------
x|x|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|
------------------------------------------------------
y|y|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|
------------------------------------------------------
z|z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|

More information at Wikipedia under Vigenère cipher.

330 questions
2
votes
3 answers

Solve vigenere code without key - python

This is the problem I have to figure out: "A message has been encryption using Vigenere encryption method discussed in class, and its cipher text EQNVZ has been intercepted. Break the code. Assume that the key is the same length as the message, and…
JR34
  • 109
  • 1
  • 4
  • 10
2
votes
2 answers

Breaking Vigenere only knowing key length

Problem I want to decode a message encrypted with classic Viginere. I know that the key has a length of exactly 6 characters. The message…
2
votes
2 answers

Making Vigenére encryption / decryption skip whitespace

I have made a menu based encryption tool using Vigenére cipher. As of now the program encrypts white spaces, how can I get the program to skip over white spaces. #creating variables to be used text_in_use = '' encrypt_key = '' decrypt_key =…
2
votes
0 answers

How can I save the tabula recta in an Array

I need to create a program, with GUI which can encrypt and decrypt the vigenere cipher. And I would start with saving the tabula recta in an array but I dont really have any experience with doing "bigger" projects. I cant really figure out how to…
David
  • 21
  • 1
2
votes
1 answer

Why am I getting random undefined chars in my decryption output in my Vigenere Cipher algorithm?

I am working on my own Vigenere Cipher in JavaScript. I enjoy it. Anyway, the encryption and decryption is the same except decrypt() is '-' keyStr instead of '+' towards the bottom. The encryption works perfectly. But, for some reason, when…
2
votes
1 answer

Memory Allocation, Outputting Garbage

Why is this outputting garbage instead of char values in arrayLetter? When I put the for loop to print the arrayLetter above the method calls it works; when I put it below it, it doesn't work. I did not change arrayLetter in the methods or in the…
NeedHlub
  • 21
  • 3
2
votes
2 answers

I have an error, but I am not figuring out what is causing it

I am taking a previously written caesar cipher and adding it to a vigenere cipher. I am getting a NameError code and do not know how to resolve it def alphabet_position(letter): alphabet_pos = {'A':0, 'a':0, 'B':1, 'b':1, 'C':2, 'c':2, 'D':3, …
kcbusymom
  • 25
  • 3
2
votes
2 answers

Vigenere's cipher in C several problems

I have made program which encrypts and decrypts Vigenere's cipher but I have several problems. Here is one: First letter of sentence is encrypted incorrectly. Second one: After sentence I have letter K. I think that's because of space but I don't…
popcorn
  • 43
  • 1
  • 5
2
votes
1 answer

What's wrong with my cs50 vigenere code? I am close on the output

I have spent hours on this and I am still stuck. I am getting the following output when I do my check. Do the errors have something to do with the way I am printing it out? :) vigenere.c exists :) vigenere.c compiles :( encrypts "a" as "a"…
TyM
  • 53
  • 4
2
votes
3 answers

Need fresh eyes on a cipher program

I have been working for a while on cipher program in python for an online course. I keep going back and forth between successes and set backs, and recently thought I had figured it out. That is, until I compared the output I was getting to what…
Brian Burns
  • 93
  • 1
  • 12
2
votes
1 answer

How to repeat characters in array

I am trying to implement Vigenere's Cipher in C but the problem is that when I try to repeat the key used in the array it is in, it breaks after the 4th letter. So if the key is ABC and the plaintext is HELLO, it returns HFNLO instead of HFNLP. When…
2
votes
1 answer

Vigenere Cipher Using Command Line Prompts

I'm trying to write a Vigenere Cipher that reads in (-e to encrypt, -d to decrypt), a key word (used during the encryption), a text file where the original message comes from, and another text file where the encrypted/decrypted message is outputed…
2
votes
2 answers

Using python for frequency analysis

I am trying to use python to help me crack Vigenère ciphers. I am fairly new to programming but I've managed to make an algorithm to analyse single letter frequencies. This is what I have so far: Ciphertext = str(input("What is the cipher…
2
votes
1 answer

Vigenere Cipher In C not working

I am attempting to make the vigenere cipher. Information about it is here: https://www.youtube.com/watch?v=9zASwVoshiM My code doesnt seem to work for a few cases. My code is listed below please dont send me a link how to make the vigenere cipher…
Kalyan Nadimpalli
  • 299
  • 1
  • 2
  • 10
2
votes
1 answer

Vigenere Cipher Python giving foreign characters instead of English

This code is meant to encrypt and decrypt using the Vigenere Cipher technique and when I choose encryption and enter my key word and text the outcome is a bunch of foreign characters printed one at a time on individual lines like this: L Lo lou…
1
2
3
21 22