[Cialug] Complete C source online
Morris Dovey
mrdovey at iedu.com
Wed Jul 24 19:11:59 CDT 2013
On 7/24/13 3:33 PM, Jeffrey Ollie wrote:
> What's the encryption algorithm used here? Based on the lack of
> comments in the code am I right that this is an algorithm that you've
> invented yourself?
The sample program can perform three operations on an entire file:
[1] It can move every byte to another (randomly selected) byte position;
[2] It can move every bit to another (randomly selected) bit position;
[3] It can (randomly) complement/not complement each and every bit.
Each of the operations is prefaced by seeding the PRNG with a portion of
the key, and then the operation to be performed is selected randomly.
This process is repeated until the entire key has been used up. The
actual code that does this is the line:
for (i=0; i<KEYS; i++) op[key[(h + i) % KEYS] % nops](key[i],b,n);
where KEYS is the number of elements in key[];
key[] is the array that contains the key;
nops is the number of elements in op[];
op[] is an array of function pointers;
b is a pointer to the file data;
n is the length of the file;
h is one half the number of key elements;
i is the loop index
It’s hard to think of this as an “invention” - it’s more like a
straight-forward way to FUBAR a file so thoroughly that without the
original key, there’s no feasible way to backtrack to the original data.
More information about the Cialug
mailing list