Encipher a message using a keyword

Assignment Help Computer Engineering
Reference no: EM131675

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: EM131675

Questions Cloud

Establish a pre- and post-money valuation : Assume as a VC that you want to establish a pre- and post-money valuation in support of the issuance of a term sheet
Describing variables, stating assumptions, illustrating mode : Show all work by describing variables, stating assumptions, illustrating model and showing output solution to the problem.
Risk and return : Investing in the stock market and Risk-free investment and inflation
The total number of slots available in the zone : The total number of slots available in the zone, the total number of bicycles in the zone at the beginning of the period
Encipher a message using a keyword : The first program will encipher a message using a keyword and second program will decipher a message using a keyword.
Write the constructor function makestk : Write the constructor function makestk, predicate function emptystk and mutator functions pushstk and popstk
Bourne shell and design suitable functions : Bourne shell and design suitable functions
Net salvage value : Evaluate Net Salvage Value
Mergers and acquisitions : Track record of mergers and acquisitions

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Application to computer science

Find the matrices that represent the relations.

  Convert csv file into html file

Convert CSV file into HTML file

  Implementation of type data structures

How can string and word variable type data structures be implemented?

  Library management system

Prepare a module which can exhibit the Library Management System

  Security policy document project

Analyze security requirements and develop a security policy

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Calculate the component voltages

Input voltage will be a step voltage that is 0 volt before time t = 0 and V in

  Describe stages of the processor

Describe the decode stage and Describe the execution stage of add, andi, mul, divi, and neg.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Write an essay on wifi performance

Write an essay on WiFi performance

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