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
1
vote
1 answer

Struggling with wraparound counting in C

I'm a newbie, so apologies if I don't explain myself well. If it helps, I'm doing this for the Caesar problem set as part of the Harvard CS50x OpenCourseWare. I'm trying to convert user generated plain text to cipher text using a simple key. To…
irlupe
  • 11
  • 3
1
vote
3 answers

Implementation of the Caesar cipher

I have to Implement a static public method named encodeCaesar in the class Functionality.java, which encodes a text using Caesar encryption and I am a complete novice in Java. Signature: encodeCaesar(String s, int val) : String The method gets a…
1
vote
1 answer

Coding caesar encryption code asks for key twice?

I implemented the caesar-cipher algorithm but it seems that I didn't catch all the details because when I run the program, it asks for the key to be input twice! #include #include #define SIZE 1024 char text[SIZE]; int…
1
vote
3 answers

CS50 Caesar how do I atoi?

I'm 3 weeks into CS50 and have spent a full day trying to get atoi to work. I'm getting the below error when compiling the below code. My questions are: How do I represent each single character in the atoi() function? How do I only print the…
TPLFIRE
  • 21
  • 5
1
vote
1 answer

Caesar Cipher with a key of a word Haskell

I am coding a caesar ciper where the key is inputted as a word and the numerical values from that word are the shift factors (the number pattern will repeat if not long enough). I am only applying this to upper case letters. There is either…
Jane
  • 47
  • 8
1
vote
0 answers

Potential buggy content in caesar cipher website

I'm writing a program to perform simple caesar decryption and encryption. I looked at the tutorial via the link http://www.math.stonybrook.edu/~scott/papers/MSTP/crypto/3Caesar_Cipher.html. My question is that to encrypt the string abcde fghij klmno…
1
vote
1 answer

Caesar Cipher in p5js

I'm a super noob, and I'm trying to make a Caesar cipher in p5js, so far I manage to code the UI, but now I'm stuck and don't really know how to move forward can someone please help? I know I need to use for loops, but I can't figure out how? I…
M0bi0usOne
  • 23
  • 5
1
vote
1 answer

What causes `Prelude.chr: bad argument`?

I have the following Haskell program I wrote, the purpose of which is to function like a Caesar cipher: 1 import System.IO 2 import System.Environment 3 import System.Exit 4 import Data.Char 5 6 shiftRight :: Int -> Char -> Char 7…
1
vote
2 answers

How to move 3 alphabets backwards in lowercase letter?

I am trying to implement Caesar Cipher in Kotlin. In Caesar Cipher you encrypt the message by substituting a letter with some fixed number of positions down the alphabet. You can look here for more information and also the approach I adopted for…
Silver Sky
  • 431
  • 2
  • 12
1
vote
1 answer

how can i convert my alphabetical index back to Ascii code in C?

string plaintext = get_string("plaintext;"); for (size_t k = 0; k
user13811196
1
vote
2 answers

Undefined identifier/ undeclared

I recently started C++ and I wanted to create a simple ceaser cipher function that could be called on, however because I copied the coding structure form my python program I seem to be getting 4 errors and 2 warnings. The mode bit is a bool where…
Evorage
  • 493
  • 3
  • 15
1
vote
2 answers

CS50 Caesar Prints Random Characters

I'm a little confused with this problem, because I got it to work and submitted and got full credit, but the code only words when I print the initial variables before the loop. This code works: int main(int argc, string argv[]) { // c = (p + k)…
1
vote
1 answer

Why does this assembly program output the same string twice?

This Caesar cipher program makes de-cipher string (length is always 10) and output is output.txt file. for example below code make .txt file, ILIKEASSEM HOWAREYOUU but when i run this code, the file is ILIKEASSEM ILIKEASSEM I can't know what is…
1
vote
1 answer

Caesar Shift function in Haskell?

I have to write a shift function that searches an element's pair from a "table" (list). And if the element is not in the given list, it has to give a '#' az a result. Examples: shift [('b', 'g'), ('c', 'h'), ('a', 'f')] 'a' == 'f' shift [('b',…
Vivi
  • 75
  • 7
1
vote
3 answers

Alphanumeric Caesar's Cipher in Java

I'm trying to solve Caesar's Cipher in Java but there's a twist to it. The input string has alphanumeric values and I am unable to solve. Here's what I've attempted so far: String rotationalCipher(String input, int rotationFactor) { // Write…
youngdev
  • 535
  • 2
  • 7
  • 15