Questions tagged [vigenere]

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

71 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
1 answer
310 views

pset2 vigenere; isalpha is accepting numbers in argv[1]

I'm using the construct if(isalpha(argv[1][i]) == 0) to determine if the chars are alphabetical in argv[1] with a for loop. The program compiles, however, isalpha is not working. If I enter, for ...
user avatar
1 vote
1 answer
122 views

Vigenere print error

I've got my code to cycle through the plaintext index p and the key index. However I keep getting an error when I am printing and can't figure it out. When I use the test spec using bacon as the key ...
user avatar
1 vote
0 answers
75 views

Vigenere - Incorrect output

I have made a mistake in the equation for the new output. char newmsg = (((plain[i] - 97 + key[j % klength]) % 26) + 97); Can someone please give me a clue as to what I did wrong here? ...
user avatar
  • 47
1 vote
1 answer
738 views

Vigenere fails check50 test "encrypts "BaRFoo" as "CaQGon" using "BaZ" as keyword"

I successfully completed the Vigenere program and I was recently testing it with Check50. My problem is that there is only one test that fails, and I don't know why: :( encrypts "BaRFoo" as "CaQGon" ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
0 votes
1 answer
164 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 ...
user avatar
  • 1
0 votes
1 answer
37 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 ...
user avatar
0 votes
1 answer
79 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 ...
user avatar
0 votes
0 answers
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/...
user avatar
0 votes
1 answer
88 views

Vigenere/ PSET 2/ It works for me but it can't pass the check50

Im trying to figure out where my problem is. Usind the examples given with the keys the transcription works fine. But if i try to run check50: //Checking for right argument if (argc != 2) { ...
user avatar
0 votes
2 answers
46 views

My vigenere code is not encrypting properly

This is my code: #include <stdio.h> #include <ctype.h> #include <cs50.h> #include <stdlib.h> #include <string.h> int main(int argc, string argv[]) { int index =0; ...
user avatar
  • 1
0 votes
1 answer
21 views

Segmentation Fault in Vigenere

Goodmorning, My program compiles, but when I try to run it with only the name of the program 'vigenere', I get this. "vigenere.c:12:23: runtime error: load of null pointer of type 'char' ...
user avatar
  • 1
0 votes
1 answer
67 views

Vigenere Pset2 ciphertext question + others

(Main question- need help on this for code to work! highlighted in screenshot.) My PSET2 code works fine up until asking the user to input plaintext, but becomes funky and outputs blank spaces as the ...
user avatar
0 votes
1 answer
156 views

Segmentation Fault while Debug50 returns an output

I've been struggling with Vigenere for a while now, and now that I "believe" I got to the point, I get a segmentation fault error when I run the program. Weird thing is that while I try to spot the ...
user avatar
  • 13
0 votes
2 answers
78 views

Still struggling with vigenere

I have been futzing with this for a couple of weeks. I actually put it away while I did pset3 but, having come back to it, I'm still stuck. I spent an entire day on it this weekend and tried adding a ...
user avatar
  • 21
0 votes
1 answer
45 views

Not sure what's wrong with vigenere code

I wrote this last month and haven't touched it since because it has been a busy month. But now I have settled down and came back to programming, and I don't understand this code anymore. It's not ...
user avatar
0 votes
1 answer
194 views

pset 2 vigenere problem while executing :incompatible pointer to integer conversion passing 'string' (aka 'char *') to parameter of type 'int'

#include<stdio.h> #include<cs50.h> #include<ctype.h> #include<string.h> int check(string s); //user defined function to decide if the argv[1] ...
user avatar
0 votes
1 answer
64 views

Help on vigenere

I have run check50 several times, and the latest outputs are posted here: https://cs50.me/checks/33f04b189e5a6efb96e937504b8a90308740ab51 I do not understand why x turns into ^, or why the last ...
user avatar
  • 1
0 votes
1 answer
111 views

Pset2: Vigenere Cipher, wrong output

In the following code there is no compiling error, but it does something wrong, as it gives me a wrong output. What it is supposed to do is: when the key is 'a' and the plaintext is 'a', output 'a', ...
user avatar
0 votes
1 answer
47 views

Vigenere problem output

Hi I hope somebody can help! my program works fine but only when it gets to the end of the keyword it passes one character and doesn't print. #include <stdio.h> #include <cs50.h> #include ...
user avatar
0 votes
1 answer
219 views

vigenere python help

https://pastebin.com/DHEbSYWV help i have been stuck for the last couple of day but i feel like i am really close just need the push in the right direction. mainly for the this question. how do i go ...
user avatar
0 votes
0 answers
89 views

Vigenere strange problem with isalpha (solved it but still interesting)

Don't get the problem why some letters from my keyword are not interpreted as letters (alpha). Here my code. To try to debug it instead of printing the encrypted phrase i print the table (see below ...
user avatar
0 votes
0 answers
100 views

Vigenere - is there a simpler logic behind it?

My code for vigenere.c works for check50, but ends up being much longer than caesar.c in the encipher part.I was wondering if I was missing a simple point and have meandered through the logic behind ...
user avatar
0 votes
2 answers
94 views

Can someone please show me what I'm doing wrong, it just prints out the wrong output. Thanks in advance!

#include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int main (int argc, string argv[]) { string plain; string key; ...
user avatar
0 votes
1 answer
80 views

CS50 Vigenere code gives incorrect when detecting a non-alphabet char for plaintext

My vigenere code works fine when a single char or string is entered, however as soon as it detects a space in plaintext it gives wonky values. Please help! #include <cs50.h> #include <stdio....
user avatar
0 votes
1 answer
86 views

I have trouble enciphering in Vigenere Cipher CS50 pset2

I have issues incrementing the index of the key and wrapping the key to the beginning. I have tried what I know, I have watched the videos several times and I have been at this for 3 days. What am I ...
user avatar
0 votes
1 answer
59 views

Having problem with vigenere in cs50. Keeps returning segmentation error, even though I solved all the errors compiler pointed out

#include <cs50.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> char argument_upper (int key, char plaintext); char argument_lower (int ...
user avatar
0 votes
1 answer
96 views

I have some problems with vigenere

My English is not quite good, and it's difficult to understand videos and lectures cs50. I have some problems with vigenere. Maybe I do something wrong, help me please. #include <stdio.h> #...
user avatar
0 votes
1 answer
77 views

Pset 2 Vigenere, new to coding and cant find the problem

I am very new to coding and cant tell where the problem with this is. It does compile however when run it returns the string exactly as it was input, including non alphabetic characters. I'm unsure of ...
user avatar
0 votes
0 answers
87 views

pset2 the last stretch

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <stdlib.h> int main(int argc, string argv[]) { if(argc != 2) // RETURNS TO 1 if ...
user avatar
0 votes
1 answer
161 views

Pset2 vigenere formula

My formula for vigenere is not quite right, and I'm not sure which part is wrong, could someone leave me some bread crumbs please int j = 0; int upperk = key[j % klen] - 'A'; int lowerk = key[j % ...
user avatar
  • 65
0 votes
1 answer
51 views

unexpected output vigenere

I am getting an odd output and can't figure out why. I have tried using a debugger and tried different ways of approaching the problem. int main(int argc, string argv[]) { if (argc == 2) { ...
user avatar
0 votes
2 answers
70 views

On running as ./a.out <keyword>

On running as above the program shows segmentation fault. Why is it so? The program is for pset2 vigenere.c . What I am doing is storing the key in a string and then storing the integer value of key ...
user avatar
  • 101
0 votes
1 answer
112 views

Vigenere - at my wits end!

I've tried so hard for a week to solve this and just can't - despite some attempts from gitter to help me. I've followed some advice to index the keyword before the loop and only use one loop to ...
user avatar
  • 86
0 votes
1 answer
72 views

pset2 vigenere, wont find key in position j the second time around

i really didn't want to ask on here but i cant see the problem for this really strange result. im not 100% finished with this code, i was just checking my algorithm was working before completing it. i ...
user avatar
0 votes
1 answer
164 views

I'm on pset2 vigenere.c. need help with encryption

I've been struggling with vigenere for months. please help me to figure out my errors and guide me clearly. any help much appreciated. #include <stdio.h> #include <cs50.h> #include <...
user avatar
0 votes
0 answers
99 views

Vigenere Cipher not working!

This is my code for enciphering my plaintext : #include <stdio.h> #include <cs50.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <ctype.h> ...
user avatar
0 votes
2 answers
428 views

pset2 vigenere wraparound

I can't figure out how to wrap the k[i] in the formula c[i] = (p[i] + k[i]) % 26 I know the if and else code's are different, that's to illustrate the main implications I've tried. also the printf("%...
user avatar
0 votes
0 answers
61 views

pset2: vigenere different output

So, I just finished with my vigenere code but the output is different from the expected one. I'm posting my code and hope any of you guys finds my mistake and gives me a tip. #include <stdio.h> ...
user avatar
0 votes
1 answer
72 views

pset2 vigenere. My code handles text inconsistently

I've got it working nearly perfectly. It works if the text is in lowercase, but I see that it's not working quite right when using uppercase. In check50 it only fails with lowercase: encrypts "BaRFoo"...
user avatar
0 votes
0 answers
48 views

Vigenere program is not working correctly!

I think the keyword is not repeating itself. Kindly help! string p = GetString(); int a; for (int i=0, n=strlen(p); i<n; i++) { if (isupper(p[i])) { ...
user avatar
0 votes
1 answer
99 views

Vigenere.c: got stucked with this program

I got stucked with Vigenere.c problemset2. With this program the user must prompt a command line keyword that will be used to encrypt a plaintext that the user will later enter. In particular for ...
user avatar
0 votes
2 answers
298 views

Pset2 Vigenere "expected output, not a prompt for input"

When I checked my program, everything worked except Hax0r2. It says expected output, not a prompt for input Last time I came across this problem, it had to do with not including printf. But this ...
user avatar
  • 3
0 votes
1 answer
130 views

I am stuck on CS50 vigenere

Hi please see the link for the code I am working with. I think the layout is correct but cannot seem to find the correct algorithm to solve this problem. https://github.com/ionakathryn/cs50-pset2/...
user avatar
0 votes
0 answers
36 views

vigenere.c exists , recieving :( on the first check

:( vigenere.c exists \ expected vigenere.c to exist This must be a server end problem ,Is there anything I can do to resolve it or should I wait. I have tried checking it thrice but still am not ...
user avatar
0 votes
1 answer
110 views

i cannot increase my key correctly :(

#include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <string.h> #include <ctype.h> //Declare variables //check user's input value ...
user avatar
0 votes
1 answer
134 views

vigenere.c not printing correctly for some reason

Code: #include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> int main (int argc, char *argv[]) { if ( argc != 2 ) { printf ("ERROR 1\n"); ...
user avatar
0 votes
2 answers
159 views

cs50 vigenere output error

Man I thought I had it! I've been working on the Vigenere problem and have gotten close but keep getting this error when I check. Thoughts? :) vigenere.c exists :) vigenere.c compiles :) encrypts &...
user avatar
0 votes
1 answer
70 views

My code cipher un correctly i dont no why ??I want to cipher letters with a key ASCII value

[code hidden per academic honesty guidelines]
user avatar
0 votes
1 answer
161 views

Pset2 Vigenere text is not encrypted properly

My code seems not able to cipher the text correctly, tried to figure out the problem but failed... Can any help me? Below is my code, thank you. #include <stdio.h> #include <cs50.h> #...
user avatar