Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a utility that will perform a simple XOR cryptographic transform on a given set of data - an XOR stream encryptor. The encryption key
Create a utility that will perform a simple XOR cryptographic transform on a given set of data an XOR stream
encryptor. The encryption key will be provided by the binary data in an arbitrarilysized external file. The size of the
key in bytes will dictate the "block size." The plaintext data will be given on stdin, where the utility will then break it
into blocksized sections, XOR it against the key, and write the cypher text to stdout. After each block is processed,
the key should be rotated to the left by one bit to make a new key. This means that the key will repeat every N
blocks, where N is the number of bits in the key. The plaintext data need not be a multiple of the block size in
length, nor should it be assumed to be ASCII or Unicode text. It is also valid for the plaintext to be extremely large,
far exceeding the available memoryswap space for the system.
In addition to correctly performing the transform, the utility should be able to take advantage of multicore or multi
processor machines by implementing a multithreading scheme that processes multiple blocks of plaintext in
parallel. The number of threads should be specified as a commandline argument and, regardless of how many are
used, the output cypher text should remain the same. All error andor status information should be printed on stderr.
The utility should be written in C or C and should build on a UNIX platform. Please make sure that your
submission compiles and runs correctly with a variety of different inputs. Finally, keep in mind that you will be
evaluated not only on the correctness of your solution, but also the organization and efficiency of your code.
It is highly suggested that you provide data that shows you tested your solution and that it works as defined.
Required commandline options:
encryptUtil n #k keyfile
n # Number of threads to create
k keyfile Path to file containing key
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started