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

How does `string.maketrans()` "decrypt" a message?

Could somebody please explain this code? I know it decrypts the message, but I'm interested to know exactly how the process is done. import string original = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc " \ "dmp. bmgle gr gl…
Michael
  • 23
  • 1
  • 4
-6
votes
2 answers

I'm getting an error when compiling my code. expected expression before '>=' token

I can't figure out why my code is not compiling. I think I might have the wrong operators in my code though. I've tried using different operator signs within functions. if (encrypt <= 'A' && encrypt >= 'Z') { encrypt = encrypt + shift; else…
Chris
  • 3
  • 1
-6
votes
1 answer

How to shift characters to ASCII values in a file based on user input c++

I have an assignment using a version of Ceasar cipher but it shifts characters in a file based on user input. For instance, if the user enters the shift value as 1, it would change 'a' to 'b'. I've tried typing to the out file and adding the shift…
Holly Thorsted
  • 23
  • 1
  • 2
  • 6
-6
votes
1 answer

CS50 Caesar - ASCII letters and Output format

I've been trying to work through the less comfortable version of cs50's Caesar problem, and would just like to preface this question by saying I'm a complete beginner. The program is supposed to ask the user to input a key and plaintext, and then…
nghanima
  • 1
  • 3
-6
votes
2 answers

Caesar Cipher for CS50

I've been staring at this problem for weeks and I have nothing! It doesn't work, I know that much, but I don't know why or what's wrong. I do know that the developer spits out "error: expected expression" regarding the line I highlighted, but really…
123cnw
-7
votes
1 answer

Why is my code giving me segmentation faults?

My code is repeatedly giving me the error message segmentation fault even though I have no idea what it means. I am trying to create a Caesar cipher but my code keeps giving me error messages. I have no idea what the problem is and any help will be…
Zubin JAIN
  • 49
  • 3
-8
votes
2 answers

In line 7: What will happen if i used another number instead of 26 like %28 and why it has to be %26?

def encryption(message,skey): encryptedmessage='' for character in message: if character.isalpha()==True: if character==character.lower(): newchar=ord(character)-97 …
1 2 3
52
53