Re:Can you break my home rolled encryption?
by dchichkov on Saturday October 26, 2013 @02:13AM
(#6616565)
It feels like the key leaks a lot into the encoded sequence. Just try encoding a sequence of 0x00 0x00 0x00 0x00...
[ Parent
| on HN ]
Re:Can you break my home rolled encryption?
by dchichkov on Saturday October 26, 2013 @02:19AM
(#6616583)
And there are obvious bugs in that code, for example:
pos_a = key[pos_b] % key_size;
probably should have been:
pos_a = key[pos_b % key_size] % key_size;
And so on...
Re:Can you break my home rolled encryption?
by mtam on Saturday October 26, 2013 @02:25AM
(#6616589)
Exactly. Unless I misunderstood the code, If the key size is small (compared to the plain text size) and we know the key length, frequency analysis will work just fine.
Re:Can you break my home rolled encryption?
by quelsolaar on Saturday October 26, 2013 @03:08AM
(#6616654)
How would you go about this? Obviously the key is smaller then the message (otherwise we would use one time pad and be done with it) The key needs to be large enough that A, it cant be guessed, and B so that the branches of possible positions in it quickly becomes unmanageable.
Re:Can you break my home rolled encryption?
by gmac on Saturday October 26, 2013 @05:36AM
(#6616840)
It sounds like you might enjoy the Matasano Crypto Challenges: http://www.matasano.com/articles/crypto-challenges/
Re:Can you break my home rolled encryption?
by quelsolaar on Saturday October 26, 2013 @02:24AM
(#6616588)
Well your key doesn't have much entropy to begin with....
On a more serious note, the code you written uses a 8bit key. you need to change the line: (key[pos_c] << 31) | (key[pos_c] >> 1); to: (key[pos_c] << 7) | (key[pos_c] >> 1);
The algorithm can obviously also be modified to use 64bit chunks that could be faster on 64 bit hardware.