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

Security of a Caesar cipher cascade

I'm attempting to make the Caesar cipher slightly more secure by first attaining the ciphertext and then running the ciphertext through the cipher to give a second ciphertext. Not entirely sure how to do this, would this be a loop of the algorithm.…
Meeata
  • 3
  • 2
-1
votes
1 answer

Recursion in function causing return variable to equal 'None'

I am making a Caesar cipher in Python. I had created a function to return the message the user would want to encrypt. I then wanted to do the same for cipher key. I wanted the function to only return the key if it was between 1 and 26 because that…
user3124306
  • 685
  • 1
  • 9
  • 20
-1
votes
1 answer

IndexError: list index out of range error in python

I'm writing a vigenere cipher for a personal project and i am coming across a index error. it is saying IndexError: list index out of range. The line causing this is IndexValue = Alphabet.index(keyList[keyIncrement]) +…
-1
votes
1 answer

Shift Cipher on numbers in PHP

Im writing a combination of a vigenere and shift cipher in php, where, for characters it uses vigenere table, and for numbers it uses the lenght of the key submitted. Its encrypting just fine , but when i desencrypt it, the numbers just come as ????…
Helder Ferreira
  • 285
  • 2
  • 3
  • 18
-1
votes
1 answer

When using a Caesar decrypting program, a lot of "U"'s get output. C#

using System; class Decrypter { static void Main ( string [] args ) { //The encrypted data is read from a file to a string, this string encryptedData = System.IO.File.ReadAllText(@"C:\Users\TomTower\Desktop\Programming and Data…
Tom
  • 1
-1
votes
1 answer

Increasing a character value for encryption

I am making a program that encrypts a string by increasing the value for each character by 5. Ex) A=F, B=G etc. Here is what I have come up with so far: public class CharArray { public static void main(String[] args) { String…
-1
votes
1 answer

Function rrot(rot, s) that takes as input an integer rot and a string s and returns a copy of s that s is reversed and then shifted by rot

I'm trying to implement a similar encoding scheme to that of the Caesar Cipher for strings that contain only capital letters, underscores, and periods. Rotations are to be performed using the alphabet order: ABCDEFGHIJKLMNOPQRSTUVWXYZ_. Mycode so…
Frank
  • 339
  • 8
  • 18
-1
votes
1 answer

Trying multiple keys for Caesar cipher decryption starts with key 9 instead of 1

I don't know what is wrong with my code. It doesn't run as expected. I just want to encrypt the characters in my cstring using the conditions in the if statements, and output all the results each time the key is iterated (key from 1 to 100), but…
Alfie brown
  • 87
  • 2
  • 2
  • 9
-1
votes
1 answer

Why my caesar cipher encryption in java returning symbols

I have been trying to encrypt this from past three days, and the result is all symbols. I dont know where my program is wrong, and i have to submit this as my assignment in one day. desperately need help in this regard. My program takes in input as…
S.taj
  • 31
  • 1
  • 6
-1
votes
1 answer

Keep Spaces, Punctuation, and char Cases in Java Caesar Cipher

I'm trying to encrypt a txt file, but when i send my chars to array I lose my spaces. I want to keep my spaces along with punctuation and cases of letters. I am so close but cannot seem to do anything that doesn't make A.) everything a null…
-1
votes
2 answers

Weird output for decipher function

I have this function that decrypts a caesar encrypted message with a certain key and it gives me the right letters for the output but theres some weird blackspace after it. Here's the function: #include #include #include…
Amike925
  • 1
  • 2
-1
votes
2 answers

I want to encrypt the lowercase characters in a message by changing every letter to it's next letter. For example; 'a' becomes 'b' and 'h' becomes 'i'

def encrypt(string, new_string): i = 0 if i < len(string): if ord(string[i]) > 65 and ord(string[i]) < 97: new_string = string[i] + encrypt(string[1:], new_string) if ord(string[i]) >= 97 or ord(string[i]) ==…
pk.
  • 99
  • 3
  • 12
-1
votes
1 answer

Can anyone help me find out what's wrong? Index error in my code

I am writing a very rough Caesar Cipher in Python and it works fine with simple messages, but when I enter the full alphabet in, I get a error on my 16th line, saying that there is an index error: string index out of range. Can anyone help me find…
-1
votes
1 answer

Detecting amount of shifts in Caesar Cipher? in C

I was wondering how in a Caesar cipher one would detect the amount of shifts in a encrypted text file that is read from the program and then display that certain amount? Thank you! EDIT** I also read in a smallDictionary file for argv[2]. The rotate…
JBo
  • 89
  • 1
  • 11
-1
votes
2 answers

Encryption Python - encrypting a string

Using this program to take out spaces, punctuation, and make letters lower case... def pre_process(s): s= s.replace("'","") s= s.replace('.','') s= s.lower() s= s.replace(" ","") return s How can I encrypt a message (s) so that…
User
  • 29
  • 3