Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write program which will encrypt a file using the following approach: 1) Write a code which will create master key using PBKDF#2, additional information can

Write program which will encrypt a file using the following approach:

1) Write a code which will create master key using PBKDF#2, additional information can be found here -https://en.wikipedia.org/wiki/PBKDF2. The program must be able to support both sha256 and sha512 hashes.

Use a suitable number of iterations to deter password cracking. Include some rudimentary perf numbers in your submission, for example, how many iterations can you get in a second. Most libraries will have an implementation of this, but some older libraries may not let you change the hashing algorithm. If you need it, the specification can be found here -https://tools.ietf.org/html/rfc2898. If you end up doing your own implementation, you must verify that your implementation creates the exact same output as a library for the same hashing algorithm.

2) Derive an encryption key and an HMAC key from the master key using PBKDF#2 and one iteration. A fixed string can be used in place of the 'salt' argument as long as it is a different fixed string. Alternately, you may use the KDF defined in NIST SP-108 in counter mode (the first one). Note, you may also use the NIST 800 SP-108 KDF function, this may be harder to find in a library, but isn't hard to write. Sample code can be found on GitHub, and I will look to see if I can find my own implementation.

3) Encrypt your data using CBC chaining mode, and the app must work with 3DES, AES128 and AES256 algorithms. Use a randomly generated IV that is one block in size. Note - 3DES is normally deprecated, but the reason it is a requirement is because it forces you not to assume a block size.

4) Create an HMAC of the IV and the encrypted data.

You also need to be able to decrypt the data, which means that the app has to be able to read in the algorithms used from the metadata you wrote out in the header.

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

What is Tax Planning?

Answered: 1 week ago