C programming question - open to bidding

Completado Publicado Nov 23, 2014 Pagado a la entrega
Completado Pagado a la entrega

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

Example input/output:

$ ls -al

total 56

drwxr-xr-x 5 user staff 170 Jun 16 15:40 .

drwxr-xr-x 35 user staff 1190 Jun 16 15:39 ..

-rwxr-xr-x 1 user staff 18293 Jun 16 15:35 encryptUtil

-rw-r--r-- 1 user staff 2 Jun 16 15:37 keyfile

-rw-r--r-- 1 user staff 8 Jun 16 15:38 plaintext

$ hexdump -C keyfile

00000000 f0 f0 |??|

$ hexdump -C plaintext

00000000 01 02 03 04 11 12 13 14 |........|

$ cat plaintext | encryptUtil -n 1 -k keyfile > cyphertext

$ hexdump -C ciphertext

00000000 f1 f2 e2 e5 d2 d1 94 93 |??????..|

Programación en C iPad iPhone Desarrollo de apps móviles Objective C

Nº del proyecto: #6771285

Sobre el proyecto

6 propuestas Proyecto remoto Activo Nov 23, 2014

Adjudicado a:

kaloyan13

Hello, I can code your project in C for Linux or Windows. I have done similar projects. Can start working immed

$90 USD en 1 día
(440 comentarios)
7.4

6 freelancers están ofertando un promedio de $99 por este trabajo

hbxfnzwpf

I am very proficient in c, c++. I have 15 years c++ developing experience now, and I have worked for 5 years. My work is online game developing, and mainly focus on server side, the language is c++ under linux. I used Más

$100 USD en 1 día
(155 comentarios)
7.1
vvadimov

Hi, I'm an experienced C programmer. I would like to do this job, but first I want to ask you few questions regarding it: 1. How large the key can be? Can it be larger than memory+swap? 2. The threading can be done a Más

$90 USD en 5 días
(52 comentarios)
5.6
GeorgeKazi

Hi! I have over 10 years experience working with Unix C. I can complete this for you and I am ready to begin right away. Please contact me for further discussion. Thanks

$100 USD en 2 días
(17 comentarios)
3.9
KathrynFMurphy

A proposal has not yet been provided

$166 USD en 5 días
(0 comentarios)
0.0
JodaTheCoda

Hello, I am professional C++ developer with 6 years experience in big automotive company. Looking forward to working with you!

$50 USD en 15 días
(1 comentario)
0.0