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

How to process negative shifts in Caesars Cipher (Javascript)

I'm trying to pass Odin Projects Caesars Cipher and the test is asking to be able to convert negative shifts. Based off of my current code I am able to shift lower case but I am having some issues with B or W. it('works with negative shift',…
Chris King
  • 95
  • 1
  • 10
1
vote
1 answer

My code is not accepting command line arguments when using argv[]

I am trying to convert a command line argument to a variable (line 17, "key"). When I run the program without anything else but the name in the command line (e.g. $ ./caesar) I do not get any errors but the code does not progress past the lines…
1
vote
1 answer

Python: decrypt caesar cipher

Assignment: Write a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher. My issue: It's printing hello^3 world^2 I'm not entirely sure why. I would appreciate any and all assistance fixing or…
Navi Kzc
  • 19
  • 2
  • 8
1
vote
2 answers

Caesar Cipher without using ord, chr and loops

I struck a brick wall trying to solve this and I am not sure how to approach this problem. My idea is to compare both first characters of each string and if they are the same, save the character in the alphabet string of the index position shift. …
1
vote
2 answers

Caesar Cipher - spaces and other characters

I have created a Caesar Cipher code below but I want the returned string to include spaces and other characters. I've tried regex but this does not seem to solve the problem or maybe i'm not using it right, I'm not too sure. Any help appreciated. …
Jake
  • 149
  • 2
  • 10
1
vote
2 answers

CS50 Pset 2- ceasar cipher

It isn't showing what I want it to show that is the ciphered version of the input text but instead symbols, as I guess, looks kinda like a '?' comes out as the output in the terminal. could anyone help me in finding what I missed or did…
Gokul
  • 13
  • 2
1
vote
1 answer

Decode Diffie Hellman p,g,A given

Decode Text encrypted with DH coded with Caesar Cipher. We have to decode following text: FKXSQBQZACKFAHRSCAN DFYZSYQBSFN. I have tried to "guess" the private Key for Alice with a for loop and think I got the right one but now I'm stuck. p,g and A…
mab
  • 11
  • 2
1
vote
3 answers

CaesarCipher program that output a text file in java

I am trying to build a program that takes a text file, apply CaesarCipher method and returns and output file. import java.util.*; import java.io.*; class CaesarCipher { public static void main (String [] args) throws FileNotFoundException { …
Fady E
  • 346
  • 3
  • 16
1
vote
1 answer

C: Reprompting to enter value into argv[] - without closing by error - Caesar Cipher

I am new to programming and I am undertaking CS50 harvard course on eDX. We had assignement for caesar cipher, I am quite satisfied with my code, even though it is not perfect. But I am not sure how to make program no to close by error when not…
Draginko
  • 25
  • 2
  • 7
1
vote
1 answer

SQL Encrypt/Decrypt numbers

I wonder if that is possible in TSQL I know vigenere (cipher) encryption can encrypt values like "Hello, How are you" to become "Hfnlp, Jox crf aov" but the problem is that it keeps the numbers un-encrypted "1234567" will remain "1234567" any idea…
asmgx
  • 7,328
  • 15
  • 82
  • 143
1
vote
1 answer

Coverting java code to php with AES and Cipher

I am finding it difficult to convert a piece of code to php from java. I searched on the internet about the meaning of each line of code written in my java code example but I didn't find any. I want to understand what each line does in this…
Khan Sharukh
  • 1,151
  • 12
  • 21
1
vote
2 answers

Cipher/Decipher Python Beginner Program

Question: Can someone edit my 2 lines of code? Just wanted to point out that this is for a school assignment so I don't want to post all my code to prevent copy/plagiarism issues. Since I'm only having difficulties with a small requirement of the…
usuallystuck
  • 165
  • 2
  • 11
1
vote
1 answer

Caesar cipher with all Unicode printable characters

I want to create a Caesar cipher that can encode/decode unicode printable characters (single- and multi codepoint grapheme clusters, emojis ect.) from the whole of Unicode (except the private use area). Preferably, it will use a list of all…
Arimaafan
  • 167
  • 2
  • 7
1
vote
2 answers

How to leave punctuation unchanged in Caesar Cipher? - Python

I'm having trouble trying to leave the punctuation unchanged while encrypting or decrypting a message # encryption message = input("Enter a message to be encrypted: ") # user inputs message to be encrypted offset = int(input ("Enter an offset: ")) #…
galaxies
  • 63
  • 7
1
vote
3 answers

Print Caesar Shift in C is printing the entered text of HELLO

I am trying to perform a Caesar cipher from text from user using modulo operation with the ascii characters. But, my code simply prints the entered test. For example, when the text entered is HELLO the program returns "HELLO". The goal is for a key…
martinb
  • 135
  • 1
  • 3
  • 13