Questions tagged [caesar-cipher]

A very simple cipher in which the letters of the alphabet are substituted by a different letter that have a fixed distance to the original letter.

A very simple cipher in which the letters of the alphabet are substituted by a different letter that have a fixed distance to the original letter.

Named after Julius Caesar, because he is said to have used it.

788 questions
2
votes
1 answer

Unknown characters being displayed while printing character array

I'm creating a Caesar cipher in C and I'm having an issue when displaying the encoded message. It works if the message consists of very few characters but as soon as the message exceeds a certain amount of characters the printf function begins to…
user8587654
2
votes
2 answers

Issue with removing spaces from string in caesar cipher c#

I'm trying to make a Caesar cipher program, however I am unable to remove the spaces from the final encrypted output. I used: if (letter == ' ') continue; However this seems to not be working and I can't identify what is causing…
Ryan Easter
  • 45
  • 1
  • 12
2
votes
2 answers

I have an error, but I am not figuring out what is causing it

I am taking a previously written caesar cipher and adding it to a vigenere cipher. I am getting a NameError code and do not know how to resolve it def alphabet_position(letter): alphabet_pos = {'A':0, 'a':0, 'B':1, 'b':1, 'C':2, 'c':2, 'D':3, …
kcbusymom
  • 25
  • 3
2
votes
4 answers

Caesar Cipher (How do I convert for into .map)

It's a Caesar cipher program, I have written this code by myself and want to convert this for loop into .map JavaScript built-in function, I have tried so many times but can't figure…
Rizwan
  • 68
  • 7
2
votes
2 answers

TypeError: 'instancemethod' object is not iterable (Python)

I am pretty new with python and threading. I am trying to write a program which uses threads and queues in order to encrypt a txt file using caesar cipher. The encrypting function works well on its own when I use it exclusively, but I get an error…
Nebih Başaran
  • 59
  • 2
  • 2
  • 9
2
votes
1 answer

Buffer Use Explanation

I found this ingenious caesar cipher solution on codefights. I'm trying to understand what the buffer is doing here. b=Buffer caesarian = (m, n) => "" + b([...b(m)].map(x => (n % 26 + x + 7) % 26 + 97)) Can empty strings concatenate with typed…
user5183133
2
votes
1 answer

My cipher code will compile but does not print — what error have I made?

Pseudocode explanation of what I am attempting to do. Convert a character array into an integer array Iterate through each integer in that array and add q to it, unless that integer + q exceeds an upper bound. If it exceeds that number, return the…
Anthony O
  • 622
  • 7
  • 26
2
votes
2 answers

Python Dictionary Returning Only 1 Entry?

I've written the following code to print an upper/lower case alphabet dictionary whose values can be shifted by an integer. It keeps returning only one entry (e.g., {Z:z}), even though when I use a print statement in the for loop, I see the entire…
NewGuy_IL
  • 51
  • 5
2
votes
0 answers

caesar cipher in C, using arrays and chars, I get an error in the numbers

Here is the code, basically I gotta do the ceasar cipher in C using arrays and chars only, here is what I have so far: #include #include main () { char alfabeto[26] =…
user1314146
2
votes
2 answers

Caesar Cypher Code Not Working

I am meant to create a Caesar Cypher that takes in a parameter and shifts the code based on that parameter but my code messes up with the Upper Case and lower case. So, it's meant to be like: $ echo "I came, I saw, I conquered." | ./caesar.sh V…
xXxXXXXX
  • 11
  • 4
2
votes
1 answer

Segmentation fault in C code using `string` from cs.50.h

I have a program here where I'm trying to decode a string of letters using a ceasar cipher; essentially I'm moving each character in the string "down" a letter ("a" -> "b", "f" -> "g", "z" -> "a"). The amount that I move a letter down depends on the…
David Maness
  • 91
  • 12
2
votes
1 answer

Caesar Cipher (C#)

I would like to preface this by saying it is for an assessment, so I don't want you to directly give me the answer, I would like you to point me in the right direction, slightly tweak what I have done or just tell me what I should look into doing. I…
2
votes
2 answers

Caesar Cipher - Can't get working

I've got this task for my Python class that I am supposed to do, however I can't seem to print the end result. The aim of the task is to create a program that: Allows one to encrypt or decrypt using an offset of the users choice It should then take…
2
votes
1 answer

Python: Trying to index keyword for encryption code

I'm using a list of the alphabet, the user enters a keyword and the keyword gets indexed and added to the text you want to be encrypted. it does this however, if it is more than one character e.g. 'ab' it will only recognize it as the last…
2
votes
4 answers

Can someone explain to me how ( (c-65+k)%26)+65) works in a caesar cypher?

If c is the numerical value of an uppercase character (i.e. B is 66) and for the sake of argument, k is a key value of 2? I'm new to programming and don't understand how the modulo works in this. I know it takes the value of the remainder, but then…
noggy
  • 149
  • 1
  • 2
  • 10