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
5 answers

How can I replace multiple letters at the same time for Caesar cipher?

I'm currently working on a program that encrypts (using Caesar cipher) a user input string by replacing specific letters with custom preset letters. For instance A = R, B = T, C = O, etc. The current program: using System; class Program { …
bezunyl
  • 61
  • 6
1
vote
2 answers

Caesar Cipher Encrypt, can't print final message

def message(): answer1 = input('Welcome to the Caesar Cipher! What do you want to encrypt?') key = input('Enter the key number that you want to encrypt with. (1 - 26)') def getMessage(): while leng <= lengthOfInput1-1: …
eristic_
  • 13
  • 8
1
vote
2 answers

Issues with Caesar cipher

I have got a problem with decrypting a Caesar cipher in C#. We have to do it manually, encrypt and decrypt. I want it to write all possibilities shifting one by one (then it is easy to see the right decryption, because other 25 possibilities are…
Arya
  • 11
  • 2
1
vote
2 answers

Caesar Cipher code only Ciphers one letter not entire string

So I'm in the middle of making a simple Caesar cipher for practice and I can't get it to decipher entire strings, just individual letters. symbol_add is the function in question. Here's the code: import re alphabet =…
BananaBox
  • 33
  • 4
1
vote
1 answer

Single character mismatch in Caesar Cipher: Python

Essentially, the alphabets in the input string are cyclically rotated by k and the rest of the characters retains their form. I'm puzzled by a mismatch. For my code: import math import os import random import re import sys # Complete the…
srkdb
  • 775
  • 3
  • 15
  • 28
1
vote
3 answers

How to make element in Array change its' place

I'm beginner in JS. I've tried to understand Caesar Cipher ROT13, but it was too complicated for me. So I've tried to write my own code. Here it is below: function encrip() { var alphabet =…
Vagif Aghayev
  • 391
  • 1
  • 3
  • 13
1
vote
1 answer

How do i include white space in my Caesar Cipher program in C++?

Ok so last time I asked for help on this program because I could not convert characters to DEC and add to it. I finally got it to work thanks to some advice that was given, it's almost complete. #include using namespace std; int…
1
vote
1 answer

Caesar cipher python error

I am new to cryptography so I try to make a simple Caesar cipher program with python but it keeps returning only one letter. Can anyone help please? Here's my code: def main(): text = raw_input('input plainteks:') key =…
user10109481
1
vote
2 answers

How to open and read a file based on user input c++

I have an assignment that wants me to write a program that reads a text file, then outputs a modified version of that file using a version of Ceasar cipher that shifts the characters of the file that the user calls based on the shift amount that…
Holly Thorsted
  • 23
  • 1
  • 2
  • 6
1
vote
0 answers

Caesar Cipher Python numbers and characters

I am new to Python and I'm trying to create a Caesar Cipher. So far, I've been using my own knowledge of Python and some online resources and I have managed to come up with the code below. I wanted the program to be able to take both number and…
user9174392
1
vote
2 answers

Caesar Cipher Python

In the first For Loop below, the code successfully shifts the letters num places to the right. The issue is in the second For Loop, it doesn't reverse it completely like it's supposed to. I've included output below. Any advice would be…
Lanie909
  • 849
  • 1
  • 8
  • 11
1
vote
0 answers

ascii shift program works for almost the whole string

I have to write a program (method thingy, excuse my noobness)that has a char array as an input, converts it to numbers according to its ascii value, shifts it to whatever the inputed shift value (can be positive or negative) is, and then decrypts…
miataaaaaa
  • 21
  • 2
1
vote
3 answers

Code Caesar python

I'm trying to create a simple Caesar Cipher function in Python that shifts letters based on input from the user and creates a final, new string at the end. Problem is that the final cipher text shows only the last shifted character, not an entire…
shifoc
  • 13
  • 4
1
vote
2 answers

Swift4 Playgrounds Caesar Cipher error

I'm trying to make a caesar cipher in Swift Playgrounds but whenever the letter is for example "W" and I'm trying to shift it by 4, instead of getting "A" I just get an error. If the ascii code + shift doesn't exceed the ascii code for Z, it works…
AndreiVataselu
  • 216
  • 2
  • 16
1
vote
1 answer

Verilog modulus operator for wrapping around a range

My background is in software and I'm new to (System)Verilog so when tasked with implementing a caesar shifter (shift each letter in a string by N letters, wrapping around if necessary e.g. ABCXYZ shifted by 3 becomes DEFABC), I wrote the following,…