Questions tagged [vigenere]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Vigenere last stap

I worked the last few days on vigenere. I still don't understand it totally. I only have te get the wrap around working properly now. I have read all the other questions about the wrap around but i ...
0
votes
1answer
34 views

cs50 pset2: check50 does not accept output

I am running check50 but it will not accept my output as correct. For example, one of the conditions needed to be satisfied is: When I run the code below I obtain the desired output (CAQGON) but ...
0
votes
0answers
15 views

How can I stop the loop through the keyword when there is a nonalpha character in Vignere?

The code doesn't encrypt the nonalpha characters, so that is good, but it continues the count through the keyword rather than pausing it. So I encounter this problem: Expected: ./vigenere baz ...
0
votes
1answer
144 views

PSet2 doesn't match with Gradebook

I started the course on the 7th of January of 2020. I've done PSet0 and PSet1 with no problem. Now I'm in the middle of PSet2. I've done Caesar and submitted it. It appears in my Gradebook. Now I've ...
0
votes
1answer
21 views

pset2 Vigenere Looping Help

I'm sure I'm doing something dumb, but after spending hours searching the topic, I can't figure it out. Instead of pairing the 1st char in the keyword to the 1st char in the plaintext, the 2nd char ...
0
votes
1answer
17 views

Pset 2 Vigenere - Shift value

I am at the point in pset2 Vinegere, where I have to write the shift function. The tutorial (or guidance on the left side in sandbox) is telling me to place the following line of code after the curled ...
0
votes
1answer
18 views

vigenere not working right

Not sure why its messing up some characters . when i test with the key bacon,it returns: plaintext: Meet me at the park at eleven am ciphertext: Neg zf av uf pcx bt gzrwep oz The t and the r in the ...
0
votes
1answer
23 views

Unexpected ciphertext. When I use plaintext like meet at the park at pm. All characters are shifted

//Program to encrypt the message by using vigenere's cipher #include <cs50.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> int shift(...
0
votes
1answer
33 views

Need help understanding Pset2 Vigenere and how to increment keyword only on alphas

I've gotten stuck on Vigenere trying to shift the keyword only on letters. I've tried several different tactics; a for loop around the letters ending before the not letters, ifs, placing them in ...
0
votes
1answer
32 views

vigenere not working properly, addition is wrong

my vigenre code is not working properly. it just wont add numbers right. i traced it to find where the problem was, and it is in the addition #include <cs50.h> #include <stdio.h> #include ...
0
votes
1answer
91 views

CS50 Week 2 Vigenere Problems

I am having a problem with the Vigenere exercise in CS50 Week 2. Everything seemed going fine until I moved the "shift" function into the loop. Instead of behaving as expected, it seems to be ...
0
votes
1answer
61 views

What's wrong with my code here?

it's not printing what i expecting when i write (b) as key and (m) as plaintext for checking it prints (n) but more than expected and i don't know what i'm missing any help would be appreciated, here'...
0
votes
1answer
129 views

pset 2 CS50 2019 Vigenere

I tried checking other Vigenere solutions, but I seem to find no way to solve the problem on the loop with text[u] and argue[1][i], I just can't make after the last ith valeu to go back to 0 ith valeu?...
0
votes
1answer
69 views

I can't get my Vigenere code to skip spaces and punctuation, I don't know why

#include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> int shift(char c); int main(int argc, string argv[]) { // Checks to make sure user enters ...
0
votes
1answer
594 views

I keep getting an error: incompatible pointer types passing 'string' (aka 'char *') to parameter of type 'string *' (aka 'char **')

#include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> int shift(string argv[]); int main(int argc, string argv[]) { // Checks to make sure user ...
0
votes
1answer
61 views

Vigenère wrap around

I'm stuck on pset2 Vigenère for a couple of days now. What's left for me to do is the wrap around. A recent draft of the below program compiled and worked fine if the length of the plaintext was equal ...
0
votes
1answer
31 views

Case sensitivity of keyword in pset 6 Python Vigenere

I've been stuck on Vigenere in pset6 for a few days now, and I've finally got it. It somehow took me longer to do Vigenere in Python than in C, interestingly. But, I'm confused about one thing: why do ...
0
votes
1answer
43 views

I get 5/11 on check50 after submitting vigenere, even though my actual output and expected output are the same. Can someone please help me?

Here is my code [removed code per academic honesty guidelines] And here is the link to the check50 if it can be helpful https://submit.cs50.io/check50/b2fae7703d9488a6c2737ebd8aa7319b95daefbb
0
votes
1answer
33 views

it is running fine except of (ie key: baz ,plaintext: hello, world! ,cipher should be: iekmo, vprke! , my cipher is: iekmo, wnslc! ..thanks in advance

for (int i = 0, n = strlen(message); i < n; i++) { if (islower(message[i])) { vigenerevalue = (((int)message[i] - 97 + (int)tolower(w[i % len]) - 97) % 26 + 97); ...
0
votes
1answer
122 views

Help with PSET2, Vigenère - Final Steps

Currently doing Vigenere, and I made it to the final steps. My code for iterating over the key and the shift function are as follows: for (int j = 0; j < strlen(argv[1]); j++) { counter = ...
0
votes
1answer
48 views

PS2 Vigenere not shifting upper and lowercase correctly

The output is almost completely correct aside from the ciphertext only corresponding to the first letter in the key. $ ./vigenere BaBa Plaintext:Hello IFMMP Do I need to completely rethink how I ...
0
votes
1answer
85 views

Help with weird bug in pset2 vigenere

After finishing most of the program, for some reason when check50 attempts to encrypt BaRFoo using keyword BaZ as well as the other attempts for the variations of barfoo and "hello, world", my code ...
1
vote
2answers
57 views

PSET 2 Vigenere - only getting symbols as output

So far in Vigenere i've gotten to the point with a single character key, and when I tried to test it, everything works except my output is entirely ����. Here is my code for the shift function and ...
1
vote
1answer
184 views

Key looping in Vigenere

I've reached the final step of Vigenere, but I don't really understand how do I loop the key over plaintext. This is the shift function I've created: int shift(char c) { if(isalpha(c)) { ...
0
votes
1answer
83 views

Problem with Pset2 submission vigenere

I just wrote the program for cs50 pset2 vigenere problem. It ran perfectly when I tried to run it, with expected output. But on submitting, cs50.me check50 shows that my program does not show the ...
0
votes
2answers
51 views

CS50 Vigenere Incorrect Output

I am stuck on this problem for days, and I have no idea about where went wrong! When I typed in /vigenere ABC the ciphertext of HELLO just becomes HFN?Z. PLEASE HELP ME! #include <cs50.h> ...
0
votes
1answer
52 views

CS50 Vigenere Getting the correct result but unable to submit

I am getting the correct result from the CS50 Vigenere as long as argc does not equal to 1. When it does, it shows runtime error and therefore I am unable to submit this exercise. Can someone please ...
0
votes
1answer
175 views

pset2: vigenere.. Getting same output as the staff's solution, but still gets the score 2 out of 5.. Could some one guide me to the problem?

#include <cs50.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int shift(char c); int main(int argc, string argv[]) { // Check that ...
0
votes
1answer
76 views

Pset2 - Shifting characters in String but not getting the correct answered

i am attempting Vigenere on CS50 Pset2. I am creating a new array with same length as keyword to shift to its digit counterpart. However i am not getting the correct answer, any idea what is the ...
0
votes
1answer
33 views

Vigenère spitting out random strings

My vigenère is spitting out random strings. For example, here is a test I got from my terminal ~/pset2/ $ ./vigenere a plaintext: a ciphertext: G ~/pset2/ $ And my code is here. I suspect that ...
0
votes
1answer
62 views

In Vigenère, is the key case sensitive? SOLVED

Is the key in Vigenère case-sensitive? It doesn't say and I'm confused.
0
votes
1answer
44 views

Pset 2 Vigenere

For capital letters the key seems to be behind my -6. Such that A is -6 and F is zero. :(
0
votes
1answer
46 views

pset2 Vigenere - output overwriting “ciphertext”

I'm stuck (apologies if I just didn't find the answer to this - I did read a number of answers and didn't see a solution to this problem). I have a line in my code to print "ciphertext:" before the ...
0
votes
1answer
422 views

CS50 pset2 vigenere problem getting the shift

Problem with the shift value function ## Hi, Could anyone please take a look at the code below and help me figure out where it goes wrong. I think the problem is with the shift_value. The code ...
0
votes
1answer
236 views

pset2 Vigenere null pointer passed as argument 1, which is declared to never be null

So as stated in the title, my problem is that a null pointer is being passed to something in my Vigenere encoder. Here is my code. I will explain what I find to be the problem and give the error ...
0
votes
1answer
148 views

shifting function in vigenere not working correctly

i have been trying so hard to figure out what the shifting problem is in the encrypt function but i have no clue so i would like it if any one could tell me what is happening. I have put a "----here---...
0
votes
1answer
43 views

Vigenere producing garbage value unsure why/how

Previously i had a issue with the upper case letters but that was a issue with the if/else statements now that is fixed however garbage value still are being printed for example aaaaa when printing it ...
0
votes
0answers
51 views

vigenere.py doesn't work correctly (need help huhu)

I need help on vigenere.py, after hours of rethinking about my algorithm I could not even know where the mistake is. In this link is check50 from my code: https://cs50.me/checks/...
0
votes
1answer
57 views

Why is my ciphertext printing random values?

I am currently working on Vigenere. I have the code to where it will work if the key is very short (a few characters), but for some reason my program bums out when the plaintext is long or the key is ...
0
votes
1answer
54 views

Why isn't my key running cyclically?

I am currently working on Vigenere, and for whatever reason my key values are running through randomly and just not working. I'm new to programming, so sorry if I am missing something major in my code ...
0
votes
1answer
65 views

Vigenere-Struggling to understand why garbage values are being printed

I'm extremely new to coding so bear with me. With my code, it, unless both the key and the plaintext are lowercase garbage values, are printed ruining the encryption of the plaintext. I struggle to ...
0
votes
1answer
59 views

Vigenere cipher iteration

My code for vigenere cipher in pset2 completes all tests except the one with a comma and space in plaintext, it iterates the keyword index over comma and space and i dont know how to fix it. It should ...
0
votes
1answer
877 views

Pset2 Vigenere: Pointers/Function Question

I've been having major trouble with Vigenere. I've worked on it every day for the passed two weeks and each day, I solve one problem but encounter another. I was able to get the program with the ...
0
votes
1answer
66 views

Vigenere Caesar cipher not Returning Value

I had a rather hard time with the caesar exercise. It consists, for those of you who don't know, in inputing a number and a string, and changing the value of the string's letters by the number, eg. 1,...
1
vote
1answer
98 views

vigenere output “incompatible pointer types”

I'm trying to solve pset2 vigenere, but I'm having some troubles. I'm using two functions to adapt the key to the text and then to apply the cipher. When I run the last function, I can't get any ...
0
votes
1answer
49 views

How do you make a variable work in multiple loops?

I am trying to solve the vigenere.c problem, but there is one step that I need to figure out before my code works. I am stuck here and I don't know what else I could do. In my code, I have a variable ...
0
votes
1answer
214 views

Pset2 vigenere keyword wrapping around with modulo

I have a solution for Vigenère’s cipher that passes all of the check50 tests, however I don't think my solution for how to wrap around the keyword is what the problem is looking for. Below is my code. ...
0
votes
1answer
66 views

My “vigenere” code strange result

My code compiles and I tested it with the example "Meet me at the park at eleven am", the result was "Negh zf av huf pcfx bt gzrwep oz", and that is correct. But when I run "check50 cs50/2018/x/...
0
votes
1answer
27 views

is there something wrong with my isupper equation? because it's not enciphering uppercase letters correctly

my code works just fine if the message is in lower case, but in upper case it's not the same, even though in both cases I have the same equation applied except for the subtraction, as shown. if (...
0
votes
1answer
144 views

Pset2: vigenere. Problem with key “hello, world!”

I can't solve the problem with key "hello, world!" and understand why it appears. #include <stdio.h> #include <cs50.h> #include <string.h> #include <stdlib.h> #include <...

1
2 3 4 5
10