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
  • 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...

  • 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...

  • Need help with number 3 the last one Need help with number 3 I have already...

    Need help with number 3 the last one Need help with number 3 I have already given the whole question MATH 1030 – Application Assignment 3 Cryptography Due: Thursday, June 4, 2020 at 11:59pm Atlantic time (submit through Brightspace) You must show your work for full marks. The goal of this assignment is to use our knowledge of linear algebra to do cryptography. We will encrypt a plaintext using a cipher where the resulting ciphertext should not be legible unless...

  • **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the...

    **DO IT AS PYTHON PLEASE** The Trifid Cipher General Problem Description The Trifid cipher (not to be confused with the creatures from the classic science-fiction film "The Day of the Triffids") is an algorithm that enciphers a plaintext message by encoding each letter as a three-digit number and then breaking up and rearranging the digits from each letter's encoded form. For this assignment, you will create a set of Python functions that can encode messages using this cipher (these functions...

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
ADVERTISEMENT