Didactic Feedback Cipher

Discussion of challenges you have already solved
Post Reply
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Didactic Feedback Cipher

Post 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.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

don't worry, 32-bit is coming so you can test your mettle with that =)
johnpatcher
Posts: 6
Joined: Tue Oct 26, 2010 6:34 pm

Post 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;
Post Reply