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.

348 questions
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…
2
votes
1 answer

Vigenere cipher not working

So my teacher created this vigenere cipher and he said it was working. However, after checking its results with online vigenere ciphers it appears to not be resulting with the correct encryptions. I have no idea how to fix it and I was wondering if…
2
votes
0 answers

CS50, vigenere.c lack of argv

I tried check50, and I got some message for the command down below. #include #include #include #include #include #include int main(int argc, string argv[]) { string a = argv[1]; int s =…
user5231181
  • 31
  • 1
  • 7
2
votes
1 answer

The Vigenere algorithm in C# explanation

I came across this code: Byte Vigenere Cipher, error with decryption But trying to follow the rules I made a new question about it. The following algorithm is used and I'm trying to get a better understanding into it: Byte[] result= new…
Flak714
  • 59
  • 3
  • 9
2
votes
2 answers

Decrypting Vigenère cipher in Java

I'm trying to decrypt a cipher encrytion using a java method however my code doesn't seem to be returning correctly. I have tried to reverse the encryption process but I can't see what I'm doing wrong. Apologies, I hope this isn't a stupid question.…
Bradley
  • 617
  • 2
  • 11
  • 26
2
votes
1 answer

Byte Vigenere Cipher, error with decryption

I have to write a Vigenere encryption / decryption function that operates on full bytes (to encrypt and send files over tcp and then decrypt on the other side). My encrypting function seems to be working (more or less, can't really test it without…
Matyy
  • 21
  • 3
1
vote
1 answer

Coloring columns for the Vigenere cipher in React

I made vigenere cipher in react. everything works perfectly regarding vigenere cipher algorithm. there is just one thing i want to add. when i take one letter from text and one letter from password, i want correspongind row and column on the board…
DoLee
  • 11
  • 2
1
vote
1 answer

Decryption of text file with format other than ASCII

I've been given an encrypted file where the plaintext has a "common (but not extremely common these days)" format. ~80000 bytes It has been encrypted with what I would describe as a Vigenere cipher with modified encryption table. One byte of the key…
1
vote
1 answer

Vigenère Cipher - Python

I'm attempting a Vigenere cipher for a class. I'm to use the key word "friends" to unlock the coded message. I can't seem to get the values of the key phrase to add to the values of the coded phrase correctly. I think somehow I'm not iterating…
1
vote
1 answer

Can you use "\" in a dictionary inside Python?

I'm creating a variation of the vigenere cipher using all the ASCII characters using a dictionary. The first few lines are okay, but then I get an error for the value 3. vigenereDictionary = { "@": "0", "%": "1", "+": "2", "\": "3", "/": "4", ... I…
Kai
  • 57
  • 5
1
vote
1 answer

improved Vigenere Cipher

so I understand that Vigenere Cipher can be cracked, without key, by using frequency analysis and there are some clever ways to get the key length. My question is what if we encrypt the ciphertext again with a different set of keys? All methods I've…
darres
  • 53
  • 5
1
vote
1 answer

Conversion of alphabet into numerical values

I am trying to decode a Vigenere cipher in python knowing the ciphertext and plaintext I have a string of text in this form 'SDFJNKSJDFOSNFDF'. I want to convert each letter to a number so I'm able to decode the text, i.e. A to 1, B to 2... The idea…
ThomasL123
  • 25
  • 4
1
vote
1 answer

C - Vigenere Encryption

I made myself vigenere cypher console program in c. My code have many parts which I do understand, but the output is wrong and don't know how to fix it. My goal is to be able to encipher full paragraph. Lines 5-36 -> the table. Lines 37-51 ->…
Justin
  • 41
  • 6
1
vote
1 answer

Why my Vigenere encryption function for small letters doesn't work correctly?

I've tried implementing Vigenere's Cypher. I found out that it is used with Uppercase letters but I've made it to work for capital and small letters but the characters of a plain or cyphered text must be the same as their corresponding ones in the…
Itachi Uchiwa
  • 3,044
  • 12
  • 26
1
vote
0 answers

Vigenere Attack Identification and Matching Algorithm

I have been trying to detect a block of data encrypted with the Vigenere algorithm for a long time..I want to determine which encryption algorithm the data I have is encrypted.I don't want to reach the original version of the data. In the first…
1 2
3
23 24