Write a program that encrypts a given plaintext file

Assignment Help Computer Engineering
Reference no: EM131928014

Cryptography Assignment

Objective

The objective of this lab is to explore the different modes of operation of block ciphers by implementing 5 of the modes.

Task

Write a program that encrypts a given plaintext file with the given key. The program gets the name of the file that contains the key, name of the file that contains the plaintext, and a prefix for the names of the file containing the ciphertexts from the command line. The program will encrypt the plaintext file in the 5 modes below using 128-bit AES and produce a file for each mode below.

1. EBC

2. CBC

3. OFB

4. CFB (128-bit)

5. CTR (counter starts with 0)

After producing the 5 ciphertext files, the program will decrypt these files and store the decrypted texts in 5 separate files. NoteCBC,OFB, and CFB modes require an initialization vector (IV). Use theSecureRandom class in Java to generate the IVs. Note that you need to keep these IVs for decryptions in modes CBC, CFB, and OFB.

So, if the program is run by

encrypt key.txt plain.txt cipher

then the program will produce 10 files :

cipherECB.txt

cipherCBC.txt

cipherOFB.txt

cipherCFB.txt

cipherCTR.txt

cipherECBdec.txt

cipherCBCdec.txt

cipherOFBdec.txt

cipherCFBdec.txt

cipherCTRdec.txt.

Note that at the end of a successful run, the files cipherECBdec.txt, cipherCBCdec.txt, cipherOFBdec.txt, cipherCFBdec.txt, cipherCTRdec.txt will all contain the same data which will be the pliantext that you started with. The plaintext will be given in hexadecimal one block per line. You can assume that each line will have 32 hex digits (hence you will NOT need to do any padding.)

What tosubmit:

1. Your documented source code. DO NOT include key, plaintext, or ciphertext files, just the source code.

Reference no: EM131928014

Questions Cloud

How findings can inform evidence-based social work practice : Submit a 2-3 page paper for which you articulate a position on eating disorders in adolescent girls from diverse racial and cultural experiences.
How the healthcare provider could have used plain language : Initial response instructions were: Discuss how the healthcare provider could have used plain language and teach back to improve communication across cultures.
Hedging using options as compared to futures contracts : Discuss the advantages and disadvantages of hedging using options as compared to futures contracts.
What are some concepts behind variance analysis : Why is it important to test for variances in your data? Explain. How is variance analysis used in your profession? Provide an example.
Write a program that encrypts a given plaintext file : Write a program that encrypts a given plaintext file with the given key. The program gets the name of the file that contains the key, name of the file.
What is a one-way analysis of variance : What is a one-way analysis of variance? What is a two-way analysis of variance? Provide an example of when you would use each approach?
What is the present value of : Your uncle offers you a choice of $30,000 in 50 years or $95 today. If money is discounted at 12 percent, which should you choose?
Find the probability that in a random sample : Please assist me with the lay out to find the probability that in a random sample of 10 newborn babies the mean weight is more than 120.3 ounces
Dependent sample with two variables : What inferential statistic would you use for a independent sample with two variables?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  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.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  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.

  Prepare a proposal to deploy windows server

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

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

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

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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