Question: 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 arbitrarily-sized 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 block-sized 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 memory+swap space for the system.
In addition to correctly performing the transform, the utility should be able to take advantage of multi-core or multi-
processor machines by implementing a multi-threading scheme that processes multiple blocks of plaintext in
parallel. The number of threads should be specified as a command-line argument and, regardless of how many are
used, the output cypher text should remain the same. All error and/or 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 command-line 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!