Question

I NEED A MATHEMATICAL ALGORITHM FOR A CEASER CHYPER I CREATED. PLEASE HELP ME...THANK YOU! THE...

I NEED A MATHEMATICAL ALGORITHM FOR A CEASER CHYPER I CREATED. PLEASE HELP ME...THANK YOU!

THE SINGLE-DIGIT KEY IS 14

THE PHRASE IS "GOOD MORNING PROFESSOR"

THE CYPHER IS UCCR ACFBWBU DFCTSGGCF

I DON'T KNOW HOW TO CREATE THE ALGORITHM AND IT CANNOT BE COMPUTER GENERATED.

a. Develop a Caesar cipher-type encryption algorithm with a little more complexity in it. For example, the algorithm could alternatively shift the cleartext letters positive and negative by the amount of the key value. Variations on this are limitless.

b. Select a single-digit key.

14

c. Code a short message using the algorithm and key.

uccr acfbwbu dfctsggcf

d. Give your instructor the algorithm, key, cleartext, and ciphertext.

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

O

P

Q

R

S

T

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

My message is Good Morning Professor

0 0
Add a comment Improve this question Transcribed image text
Answer #1

01./**

02.* Caesar cipher

03.* @author Pavel Micka

04.*/

05.public class CaesarCipher {

06./**

07.* Shift (the original variant had 3)

08.*/

09.public static final int SHIFT = 3;

10.

11./**

12.* Encrypt using Caesar cipher

13.* @param s string containing only uppercase characters

14.* @return ecrypted string (closed text)

15.*/

16.public static String encipher(String s){

17.StringBuilder builder = new StringBuilder();

18.for(int i = 0; i < s.length(); i ++){

19.if(s.charAt(i) < 65 || s.charAt(i) > 90){ //znak v ASCII

20.throw new IllegalArgumentException("" +

21."The string does not contain only uppercase characters");

22.}

23.//modularly add the shift

24.char enciphered = s.charAt(i) + SHIFT > 90 ? (char)((s.charAt(i) + SHIFT) - 26) : (char)(s.charAt(i) + SHIFT);

25.builder.append(enciphered);

26.}

27.return builder.toString();

28.}

29./**

30.* Decrypt using Caesar cipher

31.* @param s string containing only uppercase characters

32.* @return decrypted string (open text)

33.*/

34.public static String decipher(String s){

35.StringBuilder builder = new StringBuilder();

36.for(int i = 0; i < s.length(); i ++){

37.if(s.charAt(i) < 65 || s.charAt(i) > 90){ //znak v ASCII

38.throw new IllegalArgumentException("" +

39."The string does not contain only uppercase characters");

40.}

41.//modularly subtract the shift

42.char deciphered = s.charAt(i) - SHIFT < 65 ? (char)((s.charAt(i) - SHIFT) + 26) : (char)(s.charAt(i) - SHIFT);

43.builder.append(deciphered);

44.}

45.return builder.toString();

46.}

47.}

Add a comment
Know the answer?
Add Answer to:
I NEED A MATHEMATICAL ALGORITHM FOR A CEASER CHYPER I CREATED. PLEASE HELP ME...THANK YOU! THE...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please can I have a UML Class diagram for the Python program below: def main(): print()...

    Please can I have a UML Class diagram for the Python program below: def main(): print() print("Welcome to Caesar Encryption and Viginere Decryption Cipher") print() print("Please select an option") option = "c" while option == "c": hello = input('Choose Caesar Cipher encrypt 1:\n' 'Choose Viginere Cipher Decrypt 2:\n') message = input('Enter a message: ') password = input('Enter a password: ') if hello == '1': viginere_cipher(message, password) elif hello == '2': viginere_cipher_decrypt(message, password) print() print("Choose an option") option = input('Enter c...

  • 12.22 Chapter 4: Encrypt Characters Simple Caesar Cipher challenge. You'll need to correct code to print...

    12.22 Chapter 4: Encrypt Characters Simple Caesar Cipher challenge. You'll need to correct code to print ciphertext character correctly. With offset of 3 the output should be ORIGINAL CHARACTERS 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 ENCRYPTED CHARACTERS D E F G H I J K L M N O P Q R S T U V W X Y Z...

  • Can someone please help me for this assignment? Cryptography — the science of secret writing —...

    Can someone please help me for this assignment? Cryptography — the science of secret writing — is an old science; the first recorded use was well before 1900 B.C. An Egyptian writer used previously unknown hieroglyphs in an inscription. We will use a simple substitution cypher called rot13 to encode and decode our secret messages. ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in...

  • I need Help to Write a function in C that will Decrypt at least one word with a substitution cipher given cipher text an...

    I need Help to Write a function in C that will Decrypt at least one word with a substitution cipher given cipher text and key My Current Code is: void SubDecrypt(char *message, char *encryptKey) { int iteration; int iteration_Num_Two = 0; int letter; printf("Enter Encryption Key: \n");                                                           //Display the message to enter encryption key scanf("%s", encryptKey);                                                                   //Input the Encryption key for (iteration = 0; message[iteration] != '0'; iteration++)                               //loop will continue till message reaches to end { letter = message[iteration];                                                      ...

  • Assignment 7: Caesar Cipher Assignment 7 You will create a Caesar cipher which allows the user...

    Assignment 7: Caesar Cipher Assignment 7 You will create a Caesar cipher which allows the user to specify the key and the text to be encrypted. A Caesar cipher is a simple substitution cipher wherein each letter in the message is shifted a certain number of spaces down the alphabet -- this number is called the key. a b c d e f g h i j k l m n o p q r s t u v w...

  • Computer Engineering 4. (20 pts) If a user of a comms system wants to utilize the...

    Computer Engineering 4. (20 pts) If a user of a comms system wants to utilize the RSA public key encryption with p = 11 and q = 7 find their public and private keys and encrypt the message, “cyber”, using the numeric value of 1 to represent an 'a', 2 = 'b', etc. Also, show the first step in the deciphering process of this message by the user (i.e. show the first calculation based off of the received cipher for...

  • MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment:...

    MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment: In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted using two different encryption algorithms. Detailed specifications: Define an abstract class that will be the base class for other two classes. It should have: A...

  • Write an FST to implement the Soundex algorithm. The Soundex algorithm is a method commonly used...

    Write an FST to implement the Soundex algorithm. The Soundex algorithm is a method commonly used in libraries and older Census records for representing people’s names. It has the advantage that versions of the names that are slightly misspelled or otherwise modified (common, for example, in hand-written census records) will still have the same representation as correctly spelled names. (e.g., Jurafsky, Jarofsky, Jarovsky, and Jarovski all map to J612). Keep the first letter of the name, and drop all occurrences...

  • Part 3: Transposition Ciphers #can't use ord or chr functions You must implement three transposition ciphers...

    Part 3: Transposition Ciphers #can't use ord or chr functions You must implement three transposition ciphers (the "backwards" cipher, the Rail Fence cipher, and the Column Transposition cipher) where the ciphertext is created via an altered presentation of the plaintext. The algorithm for each is detailed in the function descriptions in this section. (13 points) def backwards_cipher(plaintext, key): • Parameter(s): plaintext ----- a string; the message to be encrypted key ----- an integer; the number to control this cipher •...

  • LANGUAGE: PYTHON Write a function called: d_polybius(). The function applies the decryption scheme for the polybius...

    LANGUAGE: PYTHON Write a function called: d_polybius(). The function applies the decryption scheme for the polybius cipher scheme above. The start of the function call the get_polybius_square function to get the square as a string. The second scenario when the number of characters is not even, excluding ‘\n’. For instance: “71\n5” is an invalid cipher because there is no way that the last number correspond to a character (we need two numbers). A customized version of Polybius square will be...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT