# Serendipity Enigmatic variations

HAVING just written a book on the history of cryptography, I wondered if serendipity had ever resulted in the unravelling of a secret code. Nothing came to mind immediately, but eventually I realised that one of the milestones in the history of codebreaking occurred when theologians stumbled upon a technique that destroyed a hitherto uncrackable code.

One of the oldest secret codes is the substitution cipher, which turns the original message into an enciphered message by substituting each letter with a different one. So every A in the original message might be replaced with P, every B with K, and so on. There are over 400 million million million million ways of substituting the letters of the alphabet, and so a codebreaker cannot hope to decipher an intercepted message by checking every possible set of substitutions - even if it was possible to check one set of substitutions every second, it would still take roughly a billion times the age of the universe to check them all.

For over a millennium, the substitution cipher was considered unbreakable, but in the 8th-century AD, Islamic scholars made a crucial observation. Theologians were interested in establishing the chronology of the revelations contained in the Koran, and they did this by counting the frequencies of words contained in each revelation. The theory was that certain words had evolved relatively recently, and so if a revelation contained a high number of these words, then it probably belonged to the latter part of the chronology.

Significantly, the religious scholars did not stop their scrutiny at the level of words. They also analysed letters and discovered that some are more common than others. This led to the first great breakthrough in codebreaking, as documented by the Arabic polymath Al-Kindi, "the philosopher of the Arabs".

In A Manuscript on Deciphering Cryptographic Messages, Al-Kindi advised codebreakers to look for the most common letter in the encrypted text. If the original message was in English, and if the most common letter in the encrypted text is W, then this probably represents the letter E, because E is the most common letter in English. Similarly, if the second most common letter in the encrypted text is Q, then this probably represents T, because T is the second most common letter in English. And so on.

This technique, known as frequency analysis, destroyed the security of the substitution cipher. However, it needs to be applied with some care, because the frequencies in some texts are highly unusual. In 1969, the French author Georges Perec wrote La Disparition, a 200-page novel that did not use words containing the letter "e".

Simon Singh is the author of `The Code Book - the Science of Secrecy from Ancient Egypt to Quantum Cryptography', Fourth Estate, pounds 16.99

Suggested Topics
News

literature

News

television

News

### Cannabis country: Willie Nelson to sell own blend of marijuana products

news
Arts and Entertainment

### SXSW 2015

Music Why this music festival is still the place to spot the next big thing

Arts and Entertainment

### Banished: Will there be a let up from the misery?

tvReview: The latest episode was a smidgen less depressing... but it’s hardly a bonza beach party
Arts and Entertainment

### Her Royal Likeness: The real-life monarchy that inspired 'The Royals'

tv Some of the characters appear to have clear real-life counterparts
News

### Mel Brooks: Genius for whom it's still springtime

people
Arts and Entertainment

### A History of The Great War in 100 Moments

ebooksNow available in paperback
Arts and Entertainment

### The Great Composers: fourteen of the giants of Western classical music

ebooks
Arts and Entertainment

### Sean Penn's hitman fires wide of the target in half-cocked thriller The Gunman

film review
Arts and Entertainment

### Meet the stars of Channel 5's extreme body art doc

arts + ents
Arts and Entertainment

### LGBT Film Festival 2015: I Am Michael

Film review Michael Glatze biopic isn't about a self-hating gay man gone straight

Arts and Entertainment

### 'Racist and homophobic'

tvWill Ferrell’s new film Get Hard receives its first reviews
Arts and Entertainment

### Coalition: An absorbing dress rehearsal for the back room deals ahead

tvReview: Ian Grieve gets another chance to play Gordon Brown... this is the kinder version
Arts and Entertainment

### Sherlock is officially heading back in time

TV
Arts and Entertainment

### Petition launched to stop Kanye playing Glastonbury

music
Arts and Entertainment

### Caitlin Moran writes 'brilliant' new comedy

TV review
Arts and Entertainment

### Twin Peaks might not be returning after all

TV
Arts and Entertainment

### Top Gear slot sheds 4m viewers on BBC2

TV
Arts and Entertainment

### Show will 'go ten years' if HBO bosses can convince creators

Game of Thrones
Arts and Entertainment

### Sweden selects homophobic Eurovision entry

music
Arts and Entertainment

### Aidan Turner's lusty Ross is causing tremors across the Cornish coastline

Poldark review
Arts and Entertainment

### On a mission in Mexico

Mexican government reportedly paying Bond producers for positive portrayal in new filmfilm
Arts and Entertainment

### Coming soon: films you’ve more or less seen

filmWith sequels, prequels and spin-offs, Disney plays it safe... and makes a pachyderm
Arts and Entertainment

photography
News

### The QI Elves: The fact-finding overlords with their own hit podcast

people
Arts and Entertainment

### 'Words can't express how bad The Royals is...'

tv0-star review: Sean O'Grady gives it his best shot anyway

### How Marcel Dettmann thought up his compilation

##### Independent Dating
and

By clicking 'Search' you
are agreeing to our

## The saffron censorship that governs India

Zareer Masani reveals why national pride and religious sentiment trump freedom of expression

## Prince Charles' 'black spider' letters to be published 'within weeks'

Supreme Court rules Dominic Grieve's ministerial veto was invalid

## How did fandom get so dark?

Grief over Zayn Malik's exit from One Direction seemed amusing until stories of mass 'cutting' emerged. Experts tell Gillian Orr the distress is real, and the girls need support

## The cosmic collisions that have shed light on unseen parallel Universe

Dark matter study gives scientists insight into mystery of space

## Swedes introduce gender-neutral pronoun

Why, asks Simon Usborne, must English still struggle awkwardly with the likes of 's/he' and 'they'?

## Disney's mega money-making formula

'Human' remakes of cartoon classics are part of a lucrative, long-term creative plan

## Lobster has gone mainstream

Anthea Gerrie, raised on meaty specimens from the waters around Maine, reveals how to cook up an affordable feast

## 14 best Easter decorations

Get into the Easter spirit with our pick of accessories, ornaments and tableware

## Paul Scholes column

Gareth Bale would be a perfect fit at Manchester United and could turn them into serious title contenders next season

## The future of GM

The greenhouses where Monsanto 'plays God' with the future of the planet

## Britain's mild winters could be numbered

Gulf Stream is slowing down faster than ever, scientists say

## Government gives £250,000 to Independent appeal

Donation brings total raised by Homeless Veterans campaign to at least £1.25m

## The most borrowed book at Bank of England library? Oh dear

The book's fifth edition is used for Edexcel exams

## Cowslips vs honeysuckle

It's the hunt for UK’s favourite wildflower

## Did a botched blackmail attempt help Cyril Smith escape justice?

A fresh twist reveals the Liberal MP was targeted by the notorious South African intelligence agency Boss