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

Caesar cipher won't work in C

I am trying to create a Caesar cipher, so I declared a function that pushes every character 13 times. And then another function that takes a string and then encrypts or decrypts it, I did that with the for loop. But the problem is that when I run…
1
vote
1 answer

Caesar in CBC / How to XOR in Java?

I have been trying out to ''improve'' the simple Caesar encryption by encrypting in the CBC mode. As I understand, the first character has to be XORed by an initialization vector and then by the key, the output then is the first character of the…
1
vote
1 answer

Caesar cipher website in HTML and Javascript not producing output

I am making a website in HTML5 and Javascript which takes in some plaintext through textarea, applies a caesar cipher of 3, and sends the output to another textarea. However, it does not produce any output. Here is my code: …
toyotasupra
  • 79
  • 2
  • 15
1
vote
1 answer

Cryptography with Python 3.6

I have been working on Cryptography Question. What I tried to write first code with OrderedDict is this. from collections import OrderedDict alphabet = OrderedDict( [(u'a', u'ç'), (u'b', u'd'), (u'c', u'e'), (u'ç', u'f'), (u'd', u'g'), (u'e',…
1
vote
1 answer

Count up a list

Essentially I need to take an input, convert it into the corresponding number, then count up in the list for whatever is entered in "offset" and return the new corresponding numbers. For example for "de" I would translate it into "4" , "5" and I…
white
  • 129
  • 1
  • 4
1
vote
0 answers

IndexError: string index out of range. Newbie at coding

I'm pretty beginner to Python so I get the error Traceback (most recent call last): File "C:/Users/spchee/Documents/cc.py", line 43, in c("helloz", 2) File "C:/Users/spchee/Documents/cc.py", line 35, in c add_to_string(n) File…
spchee
  • 61
  • 3
1
vote
1 answer

Caesar Cipher deleting Data

I am wondering if someone can help me trouble shoot my code. It seems to be working all properly but when I go to run it that halfway through it starts to delete my data even though I never call anything to delete it. So for example my file goes…
noreturn
  • 37
  • 7
1
vote
1 answer

How can I make this Python code more efficient

I would greatly appreciate your feedback on my first ever Python project! :D Basically I am coding a Caesar Cipher and I think its pretty terribly 'optimised / efficient' if you know what I mean, this is because I copied and pasted the encrypt()…
Kieran
  • 41
  • 1
  • 2
  • 9
1
vote
1 answer

Caesar Cypher in C giving incorrect output

Trying to create a Caesar Cypher in C and getting some troublesome output from lowercase letters that exceed 'z' when shifting letters #include void confab(const char* inText, int shift, char* outText) { int i = 0; int j = 0; …
1
vote
2 answers

How can i replace a char in a String using chars from another string (Caesar Cypher)(JAVA)

I'm doing a caesar-cypher. Trying to replace all characters from a string to a certain character from the shifted alphabet. Here is my code so far public static String caesarify(String str, int key){ String alphabetNormal = shiftAlphabet(0); …
Quetzy
  • 19
  • 1
  • 4
1
vote
1 answer

python caesar chr and ord without newline and just iterate in the alphabet

I have some problem with my caesar code. 1) I don't know how to check if a character is a punctuation and print without sum. 2) print the char on the same line but when it's finished return a newline. 3) Iterate through the alphabet with big number…
Seba
  • 617
  • 1
  • 8
  • 33
1
vote
1 answer

Caesar cipher with prerequisite functions

I am following an online course for python, and we are currently working on the caesar cipher. I have seen many questions answered on the topic on this site, but non that have the caveat of having to have to previous functions used, such as in my…
Brian Burns
  • 113
  • 2
  • 13
1
vote
2 answers

Ruby Cyphering Leads to non Alphanumeric Characters

I'm trying to make a basic cipher. def caesar_crypto_encode(text, shift) (text.nil? or text.strip.empty? ) ? "" : text.gsub(/[a-zA-Z]/){ |cstr| ((cstr.ord)+shift).chr } end but when the shift is too high I get these kinds of characters: …
Clyde Brown
  • 217
  • 4
  • 17
1
vote
1 answer

Not accepting other option entered by user

I have to do the caesar cipher in C. Encryption and decrytion depending on the key and password (4 characters maximun) plus shifting direction, all three are given by the user. In my code it only takes left, and when I enter right it re-asks for the…
qwerty12345
  • 87
  • 2
  • 7
1
vote
1 answer

Encrypting/decrypting ROT in C++

HZROT.cpp: #include "HZROT.h" std::string ROTEncode(std::string instring, int rot) { std::string result; for (char a : instring) { if (a >= 'A' && a <= 'Z') result += ((int)a + rot) % (int)'Z'; else if (a >=…