Re:Can you break my home rolled encryption?
by quelsolaar on Saturday October 26, 2013 @12:04PM
(#6617832)
I have not considered this kind of game, and therefor not designed the cypher to withstand it. I need to run your code and do some tests to look in to it further.
BUT:
I currently think that the line:
key[pos_a] ^= key[pos_c] ^ i ^ output[i];
Is a problem as "output" can counteract "i". I would probably replace it with:
key[pos_a] ^= key[pos_c] ^ output[i]; key[pos_c] ^= i;
I'm also thinking about ways that "i" could influence in a less regular way and if that is useful.
Re:Can you break my home rolled encryption?
by gknoy on Saturday October 26, 2013 @01:23PM
(#6618225)
> I have not considered this kind of game, and therefor not designed the cypher to withstand it.
This seems to be the central summation of why most of us should not be rolling our own, and why peer review and cryptanalysis is so important to determine if something really is secure. :)
Re:Can you break my home rolled encryption?
by tsahyt on Saturday October 26, 2013 @03:22PM
(#6618820)
In fact I think everybody who's interested in the subject should try to roll their own crypto for the experience and fun in it. They shouldn't use it in the real world though.
Re:Can you break my home rolled encryption?
by mathgladiator on Saturday October 26, 2013 @03:32PM
(#6618870)
Is there a club for this sort of activity?
Re:Can you break my home rolled encryption?
by joshAg on Sunday October 27, 2013 @01:54AM
(#6620951)
yes. they meet at Fort Meade.
Re:Can you break my home rolled encryption?
by tveita on Saturday October 26, 2013 @12:38PM
(#6617997)
Most stream ciphers just output a pseudorandom stream to be xored with the plaintext.
Treating it as a PRG simplifies the security analysis. Letting the plaintext affect the state is more likely to hurt than help if you assume that the attacker knows or can influence parts of the plaintext.
Re:Can you break my home rolled encryption?
by quelsolaar on Saturday October 26, 2013 @08:19PM
(#6620088)
This to me is the challenge. If done the wrong way you would allow an attacker to influence the algorithm, done the right way it could remove any patterns created by the key. It seams all attacks proposed in this thread try to attack this problem, while the rest seams harder to attack.
I give you two plaintexts of the same length of my choice, you select one of them and encrypt it with a key of your choice and give me the resulting ciphertext. If I can determine with probability p>50% which of the two plaintexts you have encrypted, the cipher is considered broken at level p.
I chose the following two plaintexts relative to the C source liked to elsewhere in this thread, with
Plaintext 1: Plaintext 2: and claim that your algorithm is broken at a level of at least 95%. (I actually think it is 100% if I make the plaintext long enough, but I'm hedging my bets by conceeding 5%).I don't need the full ciphertext, the output of the following code fragment is sufficient: