Write two programsbull the first program will encipher a

Assignment Help Computer Engineering
Reference no: EM13347742

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

Reference no: EM13347742

Questions Cloud

Question oneassume as a vc that you want to establish a : question oneassume as a vc that you want to establish a pre- and post-money valuation in support of the issuance of a
Show all work by describing variables stating assumptions : show all work by describing variables stating assumptions illustrating model and showing output solution to the
Problem 1 investing in the stock marketjohnson and johnson : problem 1. investing in the stock marketjohnson and johnson jnj is trading at 68.15. jnj is a large health care
Project nbspintroductionthe public bicycle scheme loris : project nbspintroductionthe public bicycle scheme loris bikes was launched in 2010 in the city of istanbul. there are
Write two programsbull the first program will encipher a : write two programs.bull the first program will encipher a message using a keywordbull the second program will decipher
1 create the following adtsa write the constructor function : 1. create the following adts.a write the constructor function makestk predicate function emptystk and mutator functions
Part-11 how can you perform a oating point comparison you : part-11. how can you perform a ?oating point comparison? you should include two examples one in c-shell and one in
Net salvage valueallen air lines have to liquidate some : net salvage valueallen air lines have to liquidate some equipment that is being replaced. the equipment originally cost
Mergers and acquisitions play a critical part in a : mergers and acquisitions play a critical part in a corporations survival growth and profit strategies.nbsp various

Reviews

Write a Review

Computer Engineering Questions & Answers

  How overlooking project cost management detrimental

When planning a project, planning the cost, budget, and work is an important element to the project. Address the following as related to cost management. How can overlooking project cost management be detrimental to completing projects within bu..

  Describe where sequential file processing might be used

Develop an case to illustrate your definition. (The example does not have to be as elaborate. Just a record with a simple explanation)

  Article on a biomedical application using a microcontroller

Find a recent article on a biomedical application using a microcontroller and how you would design this microcontroller-based string matching detector. Which peripherals would you be using? What considerations would you take into account

  Write down a swing applet that displays

Write down a Swing applet that displays your name (Gary Vega) in blue the first time the user clicks a JButton4, and then displays your name larger and in gray second time the user clicks the JButton. Save program as JBlueGray.java

  Creating a traffic light with three small square text boxes

Create a traffic light having three small square text boxes substituted vertically on the form initially, bottom text box is solid green and other text boxes are dark gray.

  Choose third-party control available for visual basic.net

choose a third-party control available for Visual Basic.NET. Discuss how this control is used in an application. What are the advantages and disadvantages of using third-party controls in your applications.

  What is the gain of using rule sets

What is the gain of using rule sets

  What are specific examples of database failures

If you were one of the users of a damaged database, how will you be affected by such a failure and what measures could you take to prevent it.

  A program that would calculate and print the parking charges

A parking garage charges a atleast fee of $2.00 to park for up to 3 hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of 3 hours.

  Why the client receives both the web page

assume you click on a link within your Web browser to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address.

  Difference between system software and application software

What is difference between system software and application software? How do you find out the operating system version that is installed on your computer.

  Write down a c function that adds the values

Write a C function that adds the values of all elements in a two-dimensional array that is passed to the function, suppose that the array is an array of double-precision numbers having 4 rows and 5 columns.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd