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
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
  • 21
  • 1
  • 6
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
  • 61
  • 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
  • 607
  • 2
  • 9
  • 25
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

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

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
  • 1,659
  • 6
  • 20
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
vote
1 answer

vigenere encryption algorithm in c with OpenCL does not work as expected

I am trying to make vigenere encryption algorithm in c with OpenCL, i do not have experience in OpenCL. I am using mac os ( so I am running OpenCL 1.2 or 1.1 ) and building the program with Makefile. The file is compiled but the output is not what i…
1
vote
1 answer

CS50 Vigenere: wrong loop although SEEMS logical?

I'm a complete newbie trying desperately hard with this pset for the past month. At best I've got the following but this isn't working. I think my shift function is ok, and I know at the moment it's written to print integers at the end, but even…
12082019
  • 11
  • 1
1
vote
1 answer

UndefinedBehaviorSanitiser Issue - CS50 Vigenere

I am working on Vigenere (CS50) and keep getting an "UndefinedBehaviorSanitiser SEGV on Unknown Address" when I run my program with any argument that passes the initial screening. I have read about this issue but cannot find the solution. I cut my…
Remitto
  • 31
  • 7
1
vote
1 answer

Python Vigenere Cipher Encrypt method not encrypting properly

The encrypt method in my program is not encrypting correctly. I thought I figured out why using debug mode; it's because it reads the spaces between words as something it has to encrypt. So I tried typing a message without spaces but it still didn't…
Chey
  • 25
  • 4
1
vote
0 answers

How to fix this key generator?

I'm doing a vigenere encrypting in console. First I did the generation of random position in an alphabet of 37 characters. By the way, I'm using visual studio. I tried with some other messages and keys that my classmates gave me and my code worked.…
1
vote
1 answer

Encrypting a string using a key and vigenere cipher already generated by another function

I've been having trouble figuring out how to code and implement a couple functions in my program. The encrypt method that calls the get_col_index and get_row_index methods, and also the get_col_index and get_row_index methods. The encrypt method is…
Chey
  • 25
  • 4
1
vote
2 answers

Vigenere Cipher Key not working as expected

I have constructed a Vigenere cipher function that works reasonably well, except for the fact that it does not pass the coding test that I'm required to run it through. This is due to the fact that I'm using the ordinal values, while the test is…
1 2
3
21 22