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
-1
votes
3 answers

CS50 Vigenere cipher giving wrong output

I am taking Harvard's CS50 course through EDX (just for myself, this is not graded work). My Vigenere cipher from PSET2 is giving the wrong output - for example, both a key and an input of a should result in an output of a, but instead gives t.…
Eric
  • 3
  • 2
-1
votes
1 answer

C programming - Trying to make Vigenere encryption/decryption program

Can you take a look on this code please? #include #include #include char encrypt(char *abc, int *key,char text, int counter) { int i; int encryptedletter; for(i=0;i<=25;i++) { if(text==abc[i]) …
user3624383
  • 87
  • 2
  • 13
-1
votes
1 answer

Vigenere cipher in cs50

I'm working my way through an online class teaching me how to code. I'm very new to this and have been slowly making my way through this class. I've run into an issue with the vingenere cipher. It doesn't iterate the key through the whole input.…
user3658638
  • 1
  • 1
  • 1
  • 4
-1
votes
2 answers

What isn't working properly with my Vigenere cipher code?

I'm trying to make a Vigenere cipher code in C and I have done something that is wrong and I can't fix it... How do understand that something goes wrong? Well I have some examples with keyword and result cipher with Vigenere cipher like keyword:…
Nick
  • 303
  • 1
  • 3
  • 10
-1
votes
1 answer

Segmentation fault in my Vigenere encryption program

I'm new to programming. This is the code as I've written it so far. Disregard the details of the encryption itself; I know that will need more work. When I try to run the program, I get a segmentation fault error message. If argc != 2 I will get the…
-1
votes
1 answer

Using a returned value from a function in C

My goal is to make a Vigenere cipher. I am attempting to do this by getting the key from argv, getting the string from the user, then passing the message and key though a function I made which combined them and returns the new value before printing…
Corvertbibby
  • 66
  • 3
  • 8
-1
votes
3 answers

KERN_INVALID_ADDRESS has me stumped

I keep getting this error trying to run the debugger: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x00007fff8c2414f0 in strlen () Here is my code: #include…
Yamaha32088
  • 3,656
  • 8
  • 36
  • 84
-2
votes
1 answer

How can I keep track of what combinations have been tried in a brute force approach?

I'm using Python 3 to create a brute-force Vigenere decipher-er. Vigenere codes are basically adding strings of letters together. The way I want my code to work is the user puts in however any keys they want (this bit's done), the letters are turned…
imtired
  • 11
  • 3
-2
votes
2 answers

Uppercase characters in a string cannot be converted to lowercase and subtracting their ASCII value doesnt make them in alphabetical index

I am a beginner trying to learn to code. Currently I am doing the CS50 course. I have encountered a problem with the Vigenere cipher problem; please see my code on a github link below. #include #include #include #include…
-2
votes
1 answer

Struggling with Vigenere! (In C) invalid operands to binary expression ('int *' and 'int') and other things

we are now working with caesar, vigenere. I mannaged to finish caesar but vigenere is not working as good. C gives me back: invalid operands to binary expression ('int *' and 'int'). I'm not sure what the program means exactly and what is wrong…
Bo Babo
  • 7
  • 2
-2
votes
1 answer

C Subscripted value is not an array, pointer, or vector - Yes it is?

I build an app that uses the Vigenere cipher to encoded words or sentences. It works but everything was contained in main(). I'm rebuilding the app using functions. But I'm getting the error 'Subscripted value is not an array, pointer, or vector'…
James Goldstein
  • 125
  • 2
  • 11
-2
votes
2 answers

Vigenere Cipher

I am trying to make Vigenere Cipher in C. https://www.youtube.com/watch?v=9zASwVoshiM this is info about Vigenere Cipher. My code works doesnt work for certain cases like encrypts "world, say hello!" as "xoqmd, rby gflkp!" using "baz" as keyword…
-2
votes
1 answer

Vigenere-cipher wrong output

I have to program Vigenere cipher, but my output looks a bit diffrent. Input: Po treti raz sa ohlasi The key: euhwa Output: TI ANEXC YWZ WU VDLEMP What I got: TI ANEDM LHV SK SBSWSS Could you please help me to find out, why doesn't it work…
Kingusss12
  • 23
  • 3
-2
votes
1 answer

Vigenere cypher program error for cs50

I'm writing a Vigenere cypher program in C for CS50 and have it working almost perfectly. The error is that sometimes when the encryption wraps around the output is a ? symbol in a white circle. Below is my code; #include #include…
James Morrison
  • 1,411
  • 1
  • 14
  • 33
-2
votes
1 answer

CS50 PSet 2: Vigenere cipher Segmentation Fault

I an new to the subject. I tried to debug this myself, but Segmentation Fault Core dumped, comes up and I cannot figure out why. Can someone help me please? # include # include # include # include int main(int…
Kaya Roy
  • 1
  • 1
1 2 3
21
22