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
votes
2 answers

Caesar cipher in C working for lower not upper

Cipher works for islower portion but not isupper portion. For instance if I give a key of 3 and enter I like pie!! to be encrypted, I get O olnh slh!! I also tried HELLO and got NKRRU. The isupper portion is also returning punctuation instead of…
-1
votes
1 answer

C: Function Running differently in Separate instances

I am following the iTunes University: Harvard CS50 lectures in order to learn the basics of programming. I am currently trying to create a program for a text cypher. Here is the code for the entire…
shea
  • 33
  • 3
-1
votes
1 answer

Islower function glitch

I'm doing the CS50x class and I am stuck at a glitch. I asked them what was going on and no one knew what was going on. Whenever I try to print a lowercase f it always comes up as ?. Try doing 23 as the argument and abcdefghijklmnopqrstuvwxyz as the…
Jakxna360
  • 857
  • 2
  • 9
  • 31
-2
votes
1 answer

How do i modify my code below using Caesar Cipher - JAVA

I want to implement a Caesar Cipher shift to shift each letter to the left in a string by 2 .The code above shift the words right by 2 using Caeser Cipher,How do I modify my code it to make it shift left by 2. For example, “Jgnnq vjgtg!” with a…
-2
votes
1 answer

Basic ceasar cipher

Write a program that will implement a “shift right by 5” Caesar Cipher Machine. The letters will be entered one character at a time. The program will terminate when an empty input is encountered. My code alphabet = "abcdefghijklmnopqrstuvwxyz" key…
-2
votes
1 answer

Caesar Cipher technique and reverse case in javascript

I am beginner and want to make my own function. I want to hash the password by shifting every character by given x positions and reverse to lowercase/uppercase. I think the code below should return "EFGH7654" but it return 55 with no error…
-2
votes
1 answer

Why is my Java program for the Caesar cipher returning empty Strings?

I am trying to create a program that can implement the Caesar cipher to an input String. The code can compile, however, when I tested it, it always returns an empty string shown as "". I don't know how to fix this problem. I desperately need some…
Eric
  • 3
  • 2
-2
votes
2 answers

How can I change my code to accept user inputs

I have working code that encrypts a phrase using a caesar cipher but this is with predetermined inputs (HELLOWORLD and 4 as the sift). What I would like to do is enable a user to choose their own input and shift. More specifically in the…
-2
votes
1 answer

ord () expected a character

I want to decrypt the code via a txt file. But I got an error ord () expected a character, but a string of length 586 was found. Any suggestions for fix it? (i use python 3.9) def decrypt(string, shift): cipher = '' for char in string: …
cla
  • 13
  • 1
-2
votes
3 answers

Caesar Cipher - Ruby

I have to make a function that receives a phrase and encrypts it. The cipher is to each letter in alphabet the encrypted letter is 3 letter ahead. Example Alphabet: A B C D E F G ... X Y Z Ciphered: D E F G H I J ... A B C If this is my alphabet in…
-2
votes
2 answers

Brute Force Dictionary Attack Caesar Cipher Python Code not working past 18'th shift

This was made to brute force caesar ciphers using a dictionary file from http://www.math.sjsu.edu/~foster/dictionary.txt. It is run through three functions, lang_lib() which makes the text of the dictionary into a callable object, isEnglish(), which…
ZeZekeZ
  • 11
  • 1
-2
votes
1 answer

i am trying to implement a caesar cipher in java but have no ideas since i have to need a char[] key as parameters and not an int shift

public static void getkey() { char[] resultat = new char[256]; for (char r = 0; r < 256; r++) { resultat[r] = r; System.out.print(r); } } Hello , when i run this programm it shows me all the…
-2
votes
1 answer

How to use the reverse function in python correctly for a caesar cipher?

I am currently doing caesar cipher in python. What I want to put to you is, how do I use the reversed function?? import string text = input("Your message: ") print(text) alphabet = list(string.ascii_uppercase) result = '' for i in…
-2
votes
1 answer

How to make a python program to decrypt caesar cipher without key? (Frequency analysis)

I have no clue how to do this can someone help me start and guide me write a program to decrypt the caesar encrypted text. I have a program which decrypts and prints all 26 shifts, but I want to print only one right one, thank you!
Trial Acc
  • 1
  • 4
-2
votes
1 answer

Is there another way to check whether it's an integer in Caesar Cipher other than a for loop? CS50 pset2 Caesar Cipher

I'm trying to check whether argv[ 1 ] is an integer by looping through every character in argv[ 1 ] and putting them in isdigit(). Technically it works but not exactly the way I want it to. Here's my code. int main(int argc, string argv[]) { …
user11781708