Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write two programs.

• The first program will encipher a message using a keyword;

• The second program will decipher a message using a keyword.

Here is an example of a user interaction with the encipher program: Program output is in bold and user input is in italics.

Enter the keyword: Javabean

Enter the message (end with a blank line):
We are the Borg!
We jqe sde Amqc!
Resistance is futile!
Qerfrsjlve fr ntsfie!

Here is an example of a user interaction with the decipher program:

Enter the keyword: Javabean

Enter the message (end with a blank line):

We jqe sde Amqc!
We are the Borg!
Qerfrsjlve fr ntsfie!
Resistance is futile!

This is how enciphering works. First, the keyword is used to create a "ciphertext" alphabet. The keyword is written out with repeated letters removed, and then the remaining letters of the normal alphabet (the "plaintext" alphabet" are added). So from "Javabean", we get:

For this purpose, we ignore the case of the letters, treating them all as lowercase. Now to encipher a message, we replace each letter in the message with the corresponding ciphertext letter. Other characters, like spaces and punctuation, are left unchanged. Uppercase letters are converted to lowercase, substituted, and then converted to uppercase.

For example, the letter ‘B' is first converted to ‘b', which is the second letter in the plaintext alphabet, and then substituted with the second letter of the ciphertext alphabet, which is ‘a', and then converted back to uppercase, i.e. 'A'.

Deciphering is very similar, except that each letter is located in the ciphertext alphabet, and substituted with the corresponding letter from the plaintext alphabet. So, for example, ‘f' is the 9th letter in the ciphertext alphabet, so it is substituted with the 9th letter is the plaintext alphabet, which is ‘i'.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9717359

Have any Question?


Related Questions in Computer Engineering

Several basic principles or reasons make psychological

Several basic "principles" or reasons make psychological social engineering effective. These include authority, intimidation, consensus/social proof, scar- city, urgency, familiarity/liking, and trust. Table 2-6 in your ...

Suppose that a weapons inspector must inspect each of 4

Suppose that a weapons inspector must inspect each of 4 different sites 2 times, visiting one site per day. The inspector is free to select the order in which to visit these sites, but cannot visit site X, the most suspi ...

How to response to those 3 following questionsrational

How to response to those 3 following questions Rational Agent ( Artificiall intellegence) 1. There can be more than one agent program that implements a given agent function. (If you agree, provide an example; otherwise a ...

Margaret moore wants to invest in four-year bonds that are

Margaret Moore wants to invest in four-year bonds that are currently priced at $863.49. These bonds have a coupon rate of 5.1 percent and make semiannual coupon payments. What is the current market yield on this bond? (R ...

Question provide a real-world example or describe a

Question: Provide a real-world example or describe a hypothetical situation in which a legitimate organization used spam in an effective and nonintrusive manner to promote a product or service. Need 300-350 words APA sta ...

Write a program that populates an array named weekday from

Write a program that populates an array named weekday from the string SunMonTueWedThuFriSat, and then prints each day in uppercase. PERL Language

Explain the two real world examples of database what are

Explain the two real world examples of database. What are they? How do people use them? Discuss at least one situation that would arise from problems in these database, such as redundant information, breach of informatio ...

Suppose you are given a connected graph g with edge costs

Suppose you are given a connected graph G, with edge costs that are all distinct. Prove that G has a unique minimum spanning tree.

Suppose we evaluate the performance of a player based on

Suppose we evaluate the performance of a player based on the player's HR and RBI score. Assume each HR counts as 3 points while each RBI counts as 2 points. Find the playerIDs who have the highest score. -Select a random ...

Risk management software is a critical application that

Risk management software is a critical application that businesses use to gain insight on how risk drivers can impact a project and business. For this research assignment, you will do an internet search for "risk managem ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As