Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE READ INSTRUCTIONS AND CREATE TWO SEPARATE CODES (ENCIPHER AND DECIPHER)IN C++ LANGUAGE. Basic Encryption and Decryption Schemes Instead of using the XOR defined in

PLEASE READ INSTRUCTIONS AND CREATE TWO SEPARATE CODES (ENCIPHER AND DECIPHER)IN C++ LANGUAGE.

Basic Encryption and Decryption Schemes

Instead of using the XOR defined in CBC mode, we used plus (+) in Vigenere with CBC. Therefore, the encryption of Vigenere with CBC can be expressed as:

image text in transcribed

Since we have modified the CBC operation for Vigenere character cipher, we have to adapt the CBC decryption too. Once one already establishes the encryption algorithm (or encipher). The general rule for the decryption algorithm (or decipher) is to run the encryption in reverse. Following this rule, we can express the decryption of Vigenere with CBC as:

image text in transcribed

Note: the result of can be negative but modular value should not be negative. Since we have adapted both encryption and decryption of original CBC.

The plaintext input to the Vigenere CBC encipher should come from a text file. You may use any text file that is less than 4 Kilobytes in size. You can generate your text file by simply copying and pasting any text content. However, the normal text file contains upper case and lower case alphabetic characters, numbers, punctuations and other special characters including space and line feed etc.. These are way more than 26 letters defined in Vigenere cipher. So you have to preprocess the text file to eliminate all the special characters, numbers, white space and punctuations, as well as convert all upper case letters into lower case letters. The result of preprocessing should be a string of lower case letters. (as shown Figure 1) Then the encipher will use these letter sequences as the plaintext input.

image text in transcribed

In addition to the letter sequence you generated from the preprocessing. The Vigenere CBC encipher needs a key and an IV. For this assignment, you would allow the user to enter a key (key length ranges from 2 to 10) and an IV with the same length as key. You may want to mandate that the length of IV should be the same as the key. Inputs to the Vigenere CBC decipher should be the same key and IV, as well as the ciphertext. The ciphertext sequence should be generated by the Vigenere CBC encipher.

Outputs

As mentioned above, you would create two programs: one for the encipher (including the preprocessing) and one for the decipher. The outputs of the encipher program should include the following:

Original text file name

Key

IV

Block size

Plaintext (after preprocessing) printed on the screen

Number of characters in plaintext (before padding)

Ciphertext printed on the screen

Name of ciphertext file (ciphertext saved to a file)

Number of padding characters

TEXT FILE:

"Cipher block chaining (CBC) is a mode of operation for a block cipher (one in which a sequence

of bits are encrypted as a single unit or block with a cipher key applied to the entire block).

Cipher block chaining uses what is known as an initialization vector (IV) of a certain length.

One of its key characteristics is that it uses a chaining mechanism that causes the decryption

of a block of ciphertext to depend on all the preceding ciphertext blocks.

As a result, the entire validity of all preceding blocks is contained in the

immediately previous ciphertext block. A single bit error in a ciphertext block affects

the decryption of all subsequent blocks. Rearrangement of the order of the ciphertext

blocks causes decryption to become corrupted"

Please let the key : KNIGHTS

Please let IV: ENGINEER

Co = E (Po + IV) = (Po + IV + keyword) mod 26 Gj = E (P, + Cj-1)-(P, + Cj-1-keyword) mod 26 Co = E (Po + IV) = (Po + IV + keyword) mod 26 Gj = E (P, + Cj-1)-(P, + Cj-1-keyword) mod 26

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

List several costs associated with investing in a mutual fund.

Answered: 1 week ago

Question

8. Praise the trainees for their success in learning the task.

Answered: 1 week ago