Re: Please test this encryption

From: Mark Wooding (mdw_at_nsict.org)
Date: 08/20/03


Date: 19 Aug 2003 22:54:13 GMT

Strangely Placed <binary@eton.powernet.co.uk> wrote:

> The frequency analysis of this larger (678 byte) ciphertext is
> /relatively/ flat, with 227 different byte values used, which suggests
> that it's probably not a straight monoalphabetic substitution cipher.

If it were random data, I'd expect 678 (1 - e^{678/256}) =~ 630 distinct
values to appear. Also, I'd expect about 3 values to appear eight
times, about 8 or 9 to appear seven, and about 23 to appear six times.
For comparison, here's Emacs's expected-frequency table, using the
surprisingly good Poisson approximation: if q balls are thrown uniformly
at random into n bins then the expected number of bins containing k
balls at the end of it is about n e^{-l} l^k / k!, where l = q/n.

1: [ [ 0, 47.9764270878 ]
      [ 1, 127.062568615 ]
      [ 2, 168.258635784 ]
      [ 3, 148.540826903 ]
      [ 4, 98.3502740621 ]
      [ 5, 52.0949107925 ]
      [ 6, 22.995019217 ]
      [ 7, 8.70012445819 ]
      [ 8, 2.88021698372 ]
      [ 9, 0.847563851977 ]
      [ 10, 0.224471988923 ]
      [ 11, 0.0540454575605 ]
      [ 12, 0.0119280013756 ]
      [ 13, 2.43004354947e-3 ]
      [ 14, 4.59701318792e-4 ] ]

> Polyalphabetic, anybody?

Maybe. It's /nothing like/ random, certainly. I'm no good at classical
cryptanalysis; someone who is would, I suspect, have little trouble
beyond motivation.

Quick summary: no bargepole is long enough.

-- [mdw], bopping to an evanescent beat.



Relevant Pages

  • Re: Please test this encryption
    ... >> that it's probably not a straight monoalphabetic substitution cipher. ... > For comparison, here's Emacs's expected-frequency table, using the ... > at random into n bins then the expected number of bins containing k ... Another post sure that someone could easily crack the code, ...
    (sci.crypt)
  • Re: Please test this encryption
    ... >> that it's probably not a straight monoalphabetic substitution cipher. ... > For comparison, here's Emacs's expected-frequency table, using the ... > at random into n bins then the expected number of bins containing k ... interesting encryption technique. ...
    (sci.crypt)
  • Re: I function F(x) that tells me,how do i put the balls in the beans
    ... but the sequence should be ... The number of ways of putting 128 indistinguishable balls into 8 ... distinguishable bins is not the same as the number of ways of choosing ... I'm not familiar enough with the literature to point OP to a source. ...
    (sci.math)
  • Re: Balls in Bins problem
    ... Given m bins of infinite capacity and p balls. ... ball is thrown ...
    (sci.math)
  • Balls into Bins with Variable Sized Balls
    ... certain events occurring on throwing n balls at random on m bins. ... Given only the mean and variance ... of the balls set (where the random variable is the size of the ...
    (sci.math)