Skip to main content

New : Cipher Breaker, the codebreaking assistant, is now on Android Discover

▮ CipherChronicle

Image methods Scrambling

Chaotic map (logistic)

The logistic map is the simplest example of deterministic chaos: a one-line formula and unpredictable behaviour. Popularised by the biologist Robert May in 1976 to model populations, it serves as a noise generator in much of the research on image encryption.

How does the logistic map work?

Start from a number x between 0 and 1, and repeat:

x ← r · x · (1 − x)

When r is very close to 4, the sequence never settles and never repeats: it jumps all over the interval. Above all, it is sensitive to initial conditions: two starting points that differ at the fifteenth decimal give, after about fifty iterations, two unrelated sequences.

  1. Derive from the key a starting point x and a parameter r (between 3.99 and 4).
  2. Iterate the formula a few hundred times without using it, to “forget” the start.
  3. Produce one byte per iteration: the integer part of x × 256.
  4. Combine each colour byte of the image with that byte, by XOR.

Running the operation again with the same key restores the image: as with keyed XOR, encrypting and decrypting are the same operation.

What does an image processed with the logistic map look like?

Like coloured noise, with no recognisable shape or tint. Changing a single letter of the key gives another noise with nothing in common with the first.

What are the weaknesses of the logistic map?

Strengths

  • Simple: one multiplication and one subtraction per byte.
  • Spectacular avalanche effect on the key, easy to demonstrate.
  • Lossless, and involutive.

Weaknesses

  • Non-uniform stream. The sequence spends more time near 0 and 1 than in the middle: extreme bytes are more frequent than others. A good cipher stream is perfectly flat.
  • Finite precision. A computer works with 53-bit numbers: the sequence eventually loops, and the real key space is much smaller than it looks.
  • Known plaintext. A few known bytes of the image give approximate values of x; since the formula is known, r and the whole sequence follow.
  • Periodic windows. For some values of r near 4, the sequence becomes regular. A serious scheme must avoid them.
  • Destroyed by JPEG.

How do you recover the image without the key?

The classic attack starts from a known area of the image (a plain background, a banner). Each stream byte is revealed there, which pins x to within 1/256 at each step. Three or four consecutive values are enough to narrow x and r down to the exact sequence. Cryptanalysis of chaotic schemes is a field of its own, and most published proposals have been broken this way.

What are the variants of the logistic map?

  • Other maps — tent map, Hénon map (two-dimensional), Chebyshev map: same principle, different formula.
  • Coupled maps — several sequences influencing each other, to lengthen the period.
  • Chaotic permutation — sort the pixels by the sequence values instead of masking them, or do both.
  • Arnold’s cat map then logistic map — the most common pair: one scrambles positions, the other values.

In CipherChronicle

The workbench asks for a key and returns an opaque PNG. The sequence is computed the same way on the site and in the apps. Worth trying: encrypt the same image twice with two keys differing by one letter, then compare.

Demonstration

The CipherChronicle artwork is encrypted then decrypted right here, in your browser, with the same engine as the workbench. Drag the bar to compare.