Page 1 of 1

Didactic Feedback Cipher

Posted: Thu Oct 16, 2008 7:29 pm
by gfoot
It does seem interesting that this cipher would be harder to crack if the key was replaced by the previous plaintext character, rather than the previous ciphertext character, on each iteration.

Either way the key is lost after the first character. But using the plaintext to derive the next key means at least that you're not using something the attacker already knows.

But then, using the plaintext means that all of the ciphertext except the first character is independent of key. It seems odd that this would be stronger - but then, it would be very vulnerable to a dictionary attack. Of course a cipher this simple is not going to be terribly secure!

This would be harder though:

Code: Select all

k = (k + c) mod 256
and, for Didactic Feedback Cipher 2, adding x as well.

I guess 16- or 32-bit versions would also force people to solve these intelligently rather than just brute-forcing them.

Posted: Thu Oct 16, 2008 9:09 pm
by adum
don't worry, 32-bit is coming so you can test your mettle with that =)

Posted: Fri Nov 09, 2012 8:56 pm
by johnpatcher
Just another reminder for me in case I want to revisit it sometime in the future:

Code: Select all

<?php

$str = "751a6f1d3d5c3241365321016c05620a7e5e34413246660461412e5a2e412c49254a24";

$arr = array_map("hexdec", array_reverse(str_split($str, 2)));

$str = "";

for($i = 0; $i < count($arr) - 1; $i++) {

    $str .= chr($arr[$i] ^ $arr[$i+1]);
    
}

echo strrev($str) . PHP_EOL;