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

How can I exclude non-numeric keys? CS50 Caesar Pset2

I'm doing the CS50 Caesar problem and for the most part, my code works. I am not able to pass one of the check50 tests - my code does not handle non-numeric keys, and it timed out while waiting for the program to exit. I have tried utilizing isdigit…
1
vote
1 answer

Python Caesar cipher with two keys

I want to write a caesar cipher with two keys; one for vowels and another for consonants. I have words with only capital letters. I've written some code, but I know this is wrong. I want to follow that way. Can someone help me: def ceasar(word,…
piteer
  • 173
  • 7
1
vote
0 answers

Printing an index of an array in MIPS using lb and a value in a register to offset/unaligned address error

I am writing a program which is essentially (I think) a caesar cipher, however the shift is based off the setup of the keyboard rather than the actual alphabet. So, the entry letters would be: WERTYUIOPASDFGHJKLZXCVBNMQ while i would want it to…
hampet
  • 11
  • 1
1
vote
0 answers

JS Caesar Cipher - Need help reviewing my code for repeating letters

I created a function to encode or decode messages below. I am struggling with finding the error in my code however. I have the function caesar(str, num) that is moving the letters of the alphabet (in str) over one place by (num). For example when I…
rueeazy
  • 119
  • 1
  • 9
1
vote
1 answer

How do I make a javascript function a html attribute?

I have a javascript variable with parameters, but I don't know how to pass it into my html code. The javascript code is taken from https://gist.github.com/EvanHahn/2587465: var caesarShift = function(str, amount) { // Wrap the amount if…
PythonicOreo
  • 422
  • 1
  • 4
  • 14
1
vote
1 answer

Missing 1 required positional argument: 'Key' Encryption

alphabet = ' abcdefghijklmnopqrstuvwxyz' cryptMode = input("[E]ncrypt|[D]ecrypt: ").upper() if cryptMode not in ['E','D']: print("Error: mode is not Found!"); raise SystemExit startMessage = input("Write the message: ").upper() try:rotKey =…
kolobov666
  • 11
  • 2
1
vote
2 answers

How should I make users to put in the info that I want?

I just started learning computer science. I'm studying through CS50 taught at Harvard online. Well, I'm working on this one problem where I need to get the key from the user in command line, then a plaintext, and then shift that text for key amount…
1005hoon
  • 21
  • 2
1
vote
1 answer

restore original word after Caesar Cipher shifting

I write a func of Caesar Cipher. So after I shift a sentence, I want also shift back to the original sentence. For now it works only for one direction, when I shift with natural positive number, but when I try to do this with negative number, it…
yacov27
  • 29
  • 6
1
vote
2 answers

Caesar Cipher Java Decryption

I have a problem when I'm trying to decode an encrypted message. It decrypts almost everything as it should be, but when I try to decrypt 'w x y z' (all lower case), it doesn't work properly. It only decrypts those letters when they are UPPERCASE.…
1
vote
2 answers

How do i fix this problem of caesar cipher in python?

wheel = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" wlen = len(wheel) - 1 c = input("Type a word: ").upper() key = int(input("Key: ")) encrypted = '' for x in c: f = wheel.find(x) + key if x == " ": encrypted = encrypted + " " if f >…
mikal
  • 55
  • 6
1
vote
2 answers

How to check if string is nonsense or set of english words

I am trying to crack Vigenère cipher from school homework by brute-force and I want to write my own script for it, because I have no information about KEY. Is there any tool what can check how much real english words is included in input…
Baterka
  • 3,075
  • 5
  • 31
  • 60
1
vote
2 answers

How do I change each char in a string but not change punctuations in C?

I have an assignment to create a program that converts each character in a string by a set number entered at the command line. Example: if the user enters 1 at the command line then enters abc, def then the program should convert the string to bcd,…
1
vote
1 answer

Wanted to do caesar's cipher but couldn't change the last two characters

I wrote a code for caesar's cipher and the code works except I can't cipher more than 8 letters and I also can't handle spaces. It shows ">>" this symbol instead of spaces. Also, I wanted to do binary search in the second function of my code but I…
user11004300
1
vote
2 answers

How to do encryption/decyption using crypto js in ionic4?

I am trouble, how to do encryption/decyption using crypto js in ionic4? I have written code for encryption decryption in java public static String encrypt(String str) { String encryptedString = str; try { byte[] utf8 =…
Nitin Karale
  • 789
  • 3
  • 12
  • 34
1
vote
1 answer

Caesar Cipher C# - How to decrypt correctly

When I enter a string that has an 'a' and I use -1 as the shift it returns symbols. How can I fix the decryption. using System; namespace CaesarCipher1 { class Program { static string Encrypt(string value, int shift) { …
user11843114