Re: Simple cipher program help
From: Benjamin Goldberg (goldbb2_at_earthlink.net)
Date: 04/29/03
- Next message: terminal: "when the rain begins to fall"
- Previous message: terminal: "when the rain begins to fall"
- In reply to: John E. Hadstate: "Re: Simple cipher program help"
- Next in thread: John E. Hadstate: "Re: Simple cipher program help"
- Reply: John E. Hadstate: "Re: Simple cipher program help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 29 Apr 2003 14:01:44 -0400
John E. Hadstate wrote:
>
> Paul wrote:
[snip]
> > How many characters would the key have to be if input was from a
> > keyboard - 8?
>
> Yes, 8. But realize that input from a keyboard will be typically
> US-ASCII and the character encodings will *always* have the high-order
> bit cleared.
> This reduces by half the size of the keyspace you can create. (Yes I
> know; there's *that* trick, but who remembers it?)
Actually, since you're losing the high-order bit from each of 8 chars,
you're reducing the keyspace by 1/256th, not by a mere half.
Of your now 56-bit keyspace, it's reduced even further, since many bytes
are not printable characters (the first 32). This leaves 96 possible
values (about a 6.58 bit keyspace) for each of 8 letters, giving us a
keyspace which is just under 53 bits.
IIRC, it's possible for 56-bit DES to be broken by brute-force in about
3 hours.
If a single encryption operation with this new cipher takes as long as a
single DES encryption, then, using 8 keyboard chars for the key to this
cipher would mean that a brute force break takes 1/10th as long as brute
forcing DES. In other words, about 18 minutes. Even less, if one takes
into account the fact that letters are unlikely to be used in an evenly
distributed manner.
Whereas, if you used 8 *truly random* bytes, (and a single encrypt takes
as long as a single DES encrypt), then it would take 256 times *longer*
to brute force... or 32 days.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
- Next message: terminal: "when the rain begins to fall"
- Previous message: terminal: "when the rain begins to fall"
- In reply to: John E. Hadstate: "Re: Simple cipher program help"
- Next in thread: John E. Hadstate: "Re: Simple cipher program help"
- Reply: John E. Hadstate: "Re: Simple cipher program help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|