Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1240

Vigenere Cipher, one of the assignments in Problem Set 2. It's like Caesar Cipher, but with a twist.

0 votes

Vigenere Modulus

Just took a look at the code as you posted in FB. This line: printf("%c", (((message[i] - 'A') + ((toupper(key[j]) - 'A') % keylength) % 26) + 'A')); keep in mind that, in this case, "j" is your …
Irene's user avatar
  • 1,687
0 votes
Accepted

vigenere PSET 2

plaintext = 't' key = 'i' (9) It will skip the if block because 't' + 9 == 123 plaintext[i] = 97+ (leftover + argv[1][j] - 122) ; Where is the plaintext taken into account in this equation? "leftov …
Irene's user avatar
  • 1,687
2 votes

can someone help me with this problem, im getting vignere.c:58:59: runtime error: division b...

Suppose the first letter of your key is 'a'. After your for loop is done, the value stored in key[0] is no longer 97 ('a'), but 0. When you then, later, do strlen(key), the value returned is 0, beca …
Irene's user avatar
  • 1,687
2 votes
Accepted

pset2 Vigenere Modulo

In order to use modulo to wrap around the dictionary you first need to offset both key and plaintext to convert them to values between 0 and 25, and then add them and use modulo. That part is just as …
Irene's user avatar
  • 1,687
1 vote
Accepted

Problem with the key in vigenere

mean by "password" but, to get terms clear, I'll use "plaintext" for the message you input once the program is running and "key" as the key you enter at the command line argument. 1) You can't solve vigenere
Irene's user avatar
  • 1,687