caesar-cipher

How to write a Ceaser Cipher Python

余生长醉 提交于 2021-02-05 12:15:17
问题 I am not sure how to start writing the program. input = input("Input the text you would like encrypted") def cipher_text(letter_code): for i in input: number_code = ord(i) + 3 letter_code = chr(number_code) print(letter_code) def plain_text(letter_code,regular_text): for i in input: regular_text = letter_code - 3 print(regular_text) print("Encrypted text") cipher_text() print("Unencrypted text") plain_text() Sorry for the question I am not sure how to begin. Also please give advice not the

How to write a Ceaser Cipher Python

折月煮酒 提交于 2021-02-05 12:14:09
问题 I am not sure how to start writing the program. input = input("Input the text you would like encrypted") def cipher_text(letter_code): for i in input: number_code = ord(i) + 3 letter_code = chr(number_code) print(letter_code) def plain_text(letter_code,regular_text): for i in input: regular_text = letter_code - 3 print(regular_text) print("Encrypted text") cipher_text() print("Unencrypted text") plain_text() Sorry for the question I am not sure how to begin. Also please give advice not the

Caesar Cipher in p5js

情到浓时终转凉″ 提交于 2021-01-29 02:23:27
问题 I'm a super noob, and I'm trying to make a Caesar cipher in p5js, so far I manage to code the UI, but now I'm stuck and don't really know how to move forward can someone please help? I know I need to use for loops, but I can't figure out how? I really appreciate all the help Thanks let inp; let button; let alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; function setup() { createCanvas(600, 600); //

Program to crack Caesar cipher

前提是你 提交于 2021-01-29 00:16:43
问题 The Caesar cipher basically shifts each letter of plaintext by a fixed number. For example, if the key 2 is used, the word Sourpuss would be encoded Uqwrtrwuu The text can contain only the printable ASCII characters (32-126, for our purposes). Implement an algorithm for cracking this code. I need to decrypt this: "T! x$r&'}r&z! %21j!'1~zxy&1"r%%1TZedBEAB?" Here is my code: def decoded(s): for i in range(1,95): string = "" for char in s: if(ord(char) + i > 126): charc = (ord(char) + i) - 94

CS50 Caesar program is working but check50 says it isn't

蓝咒 提交于 2021-01-28 00:28:44
问题 I created this program but I'm getting errors on CS50 showing that I didn't do any of it correctly. The requirements are as follows: Implement your program in a file called caesar.c in a directory called caesar. Your program must accept a single command-line argument, a non-negative integer. Let’s call it k for the sake of discussion. If your program is executed without any command-line arguments or with more than one command-line argument, your program should print an error message of your

Caesar cipher encrypting a single character in MIPS

心不动则不痛 提交于 2020-07-16 10:22:00
问题 I'm having some problems in creating a program to encrypt a message. At this point i'm just trying to input a char and the output should be the char+5 positions in the alphabet. So the program should read the char in ASCII and add 5 to it and then print the letter. Ex.: Input: A Output: F It should only work for Capital letters, so every char should be >=65 and <=90. So, if I write 'Z' it should start the alphabet from the beginning and print 'E'. So far, my code looks like this: li $v0, 8

Caesar cipher encrypting a single character in MIPS

不想你离开。 提交于 2020-07-16 10:20:44
问题 I'm having some problems in creating a program to encrypt a message. At this point i'm just trying to input a char and the output should be the char+5 positions in the alphabet. So the program should read the char in ASCII and add 5 to it and then print the letter. Ex.: Input: A Output: F It should only work for Capital letters, so every char should be >=65 and <=90. So, if I write 'Z' it should start the alphabet from the beginning and print 'E'. So far, my code looks like this: li $v0, 8

CS50 Caesar program (pset2) runs but outputs errors in check50 (“expected exit code 1, not 0”)

家住魔仙堡 提交于 2020-06-29 03:47:52
问题 I finished pset2 (caesar) of CS50, but when I run it through check50, I get three errors, each involving the command-line arguments in some way. When I try to test it myself, it works fine, which makes me think the problem is "under the hood" and not able to be solved unless I revise my code. I tried deleting uncessary lines, but the errors still persisted, so I was wondering if someone could take a look at my code and tell me what's wrong. Here's the code: #include <stdio.h> #include <stdlib