Solution to the GCHQ challenge
As promised, here's the solution to the challenge.
The names in the two lists are those of actors and actresses. They are encoded using a simple substitution cypher. There's one cypher for each pair of men and women, built from the name of the movie they performed in together. These are the translations:
And here's how they relate to each other and the name of each movie:
The cyphers are created by taking the name of the movie, capitalizing it, removing duplicate letters and completing the string with the missing letters from the alphabet, in alphabetical order. The string is then shift-rotated by a certain number of positions.
For example, if the movie is "The silence of the lambs", we get "THESILNCOFAMB" after the first two steps. We then add the missing letters and obtain "THESILNCOFAMBDGJKPQRUVWXYZ". The cypher is then shift-rotated to produce "RUVWXYZTHESILNCOFAMBDGJKPQ".
You may be wondering how is that used to encrypt the actor name. Simple, replace each letter in the name with the letter that appears in the cypher in the position that corresponds to the original letter's position in the alphabet. For instance, to encrypt an F we look at the 6th position in the cypher (F is the 6th letter of the alphabet) and find a Y.
To find the hidden quotation we first listing all cyphers to form a matrix (26x20). They should be sorted according to the movie release date, in ascending order. The hidden quotation can be read from the diagonal of the matrix, starting top-left corner and going down and to the right. The phrase reads "Here's looking at you, kid", a quote from Casablanca.
Here's a Ruby script to automate the decryption process. You'll also need to get the list of movies and the actors.list and actresses.list files from IMDB's text database.
The names in the two lists are those of actors and actresses. They are encoded using a simple substitution cypher. There's one cypher for each pair of men and women, built from the name of the movie they performed in together. These are the translations:
Men | |
QJAMDU WWVDU | MICKEY ROONEY |
KCRVKXHL EUJDXZ | HUMPHREY BOGART |
XCT GSXXJYUQ | REX HARRISON |
JRFJWRI XFCS | GREGORY PECK |
NRIKUSL UIQORMDB | CHARLES LAUGHTON |
QFDX ORNQTP | TONY CURTIS |
UFIV WKXXZY | JACK LEMMON |
HYUE WREEYCS | SEAN CONNERY |
WKNJVWL GSWOXU | RICHARD BURTON |
BZGZD A'GAANZ | PETER O'TOOLE |
VTWMAC UEIIML | ALBERT FINNEY |
ZGRT BPDIIRNN | ALEC GUINNESS |
XIVL VFBD | JOHN HURT |
GMTHYL IKUBGMFPTPSSPM | ARNOLD SCHWARZENEGGER |
OFIIPTYX LYIJ | HARRISON FORD |
RNBTCNP TCOSHNM | ANTHONY HOPKINS |
KEZHQ WSNIEC | KEVIN SPACEY |
LVZD CONKLNFK | EWAN MCGREGOR |
DYFJN WCLEQPJ | TOBEY MAGUIRE |
PZSS TEBBMJ | BILL MURRAY |
Women | |
LRNU FHZOHVN | JUDY GARLAND |
MTJXMG EHXJRDT | INGRID BERGMAN |
OSXFSXCZ XBZGCXDUXA | MARGARET RUTHERFORD |
YAERFI KFXBARV | AUDREY HEPBURN |
AIKUSBS EHSMKHNR | MARLENE DIETRICH |
CZNTBXD CFDNFE | MARILYN MONROE |
AQSEWKC XFIWFSYK | SHIRLEY MACLAINE |
ORERC VIUWFNUE | HONOR BLACKMAN |
BQKDVGBOJ OVIQXW | ELIZABETH TAYLOR |
OUGEUDLRZ EZBVJDR | KATHARINE HEPBURN |
TVFAMI WVYVTT | LAUREN BACALL |
TZMMDR WDNCRM | CARRIE FISHER |
CWUIFBLSK HSOGSB | SIGOURNEY WEAVER |
YVTLG UGZVYNHT | LINDA HAMILTON |
RKUUC VHMPUUPT | KELLY MCGILLIS |
ECWHX YCMBXA | JODIE FOSTER |
KHP FNWHQBEV | KIM BASINGER |
DGOFBL AGUCZD | NICOLE KIDMAN |
UQPIDJX HEXID | KIRSTEN DUNST |
CQMBSVDD LNYMICCNI | SCARLETT JOHANSSON |
And here's how they relate to each other and the name of each movie:
STRIKE UP THE BAND | MICKEY ROONEY | JUDY GARLAND |
CASABLANCA | HUMPHREY BOGART | INGRID BERGMAN |
BLITHE SPIRIT | REX HARRISON | MARGARET RUTHERFORD |
ROMAN HOLIDAY | GREGORY PECK | AUDREY HEPBURN |
WITNESS FOR THE PROSECUTION | CHARLES LAUGHTON | MARLENE DIETRICH |
SOME LIKE IT HOT | TONY CURTIS | MARILYN MONROE |
THE APARTMENT | JACK LEMMON | SHIRLEY MACLAINE |
GOLDFINGER | SEAN CONNERY | HONOR BLACKMAN |
WHO'S AFRAID OF VIRGINIA WOOLF | RICHARD BURTON | ELIZABETH TAYLOR |
THE LION IN WINTER | PETER O'TOOLE | KATHARINE HEPBURN |
MURDER ON THE ORIENT EXPRESS | ALBERT FINNEY | LAUREN BACALL |
STAR WARS | ALEC GUINNESS | CARRIE FISHER |
ALIEN | JOHN HURT | SIGOURNEY WEAVER |
THE TERMINATOR | ARNOLD SCHWARZENEGGER | LINDA HAMILTON |
WITNESS | HARRISON FORD | KELLY MCGILLIS |
THE SILENCE OF THE LAMBS | ANTHONY HOPKINS | JODIE FOSTER |
LA CONFIDENTIAL | KEVIN SPACEY | KIM BASINGER |
MOULIN ROUGE | EWAN MCGREGOR | NICOLE KIDMAN |
SPIDERMAN | TOBEY MAGUIRE | KIRSTEN DUNST |
LOST IN TRANSLATION | BILL MURRAY | SCARLETT JOHANSSON |
The cyphers are created by taking the name of the movie, capitalizing it, removing duplicate letters and completing the string with the missing letters from the alphabet, in alphabetical order. The string is then shift-rotated by a certain number of positions.
For example, if the movie is "The silence of the lambs", we get "THESILNCOFAMB" after the first two steps. We then add the missing letters and obtain "THESILNCOFAMBDGJKPQRUVWXYZ". The cypher is then shift-rotated to produce "RUVWXYZTHESILNCOFAMBDGJKPQ".
You may be wondering how is that used to encrypt the actor name. Simple, replace each letter in the name with the letter that appears in the cypher in the position that corresponds to the original letter's position in the alphabet. For instance, to encrypt an F we look at the 6th position in the cypher (F is the 6th letter of the alphabet) and find a Y.
To find the hidden quotation we first listing all cyphers to form a matrix (26x20). They should be sorted according to the movie release date, in ascending order. The hidden quotation can be read from the diagonal of the matrix, starting top-left corner and going down and to the right. The phrase reads "Here's looking at you, kid", a quote from Casablanca.
HBANDCFGJLMOQVWXYZSTRIKEUP | STRIKE UP THE BAND |
DEFGHIJKMOPQRTUVWXYZCASBLN | CASABLANCA |
SPRACDFGJKMNOQUVWXYZBLITHE | BLITHE SPIRIT |
YBCEFGJKPQSTUVWXZROMANHLID | ROMAN HOLIDAY |
ITNESFORHPCUABDGJKLMQVXYZW | WITNESS FOR THE PROSECUTION |
ZSOMELIKTHABCDFGJNPQRUVWXY | SOME LIKE IT HOT |
FGIJKLOQSUVWXYZTHEAPRMNBCD | THE APARTMENT |
UVWXYZGOLDFINERABCHJKMPQST | GOLDFINGER |
VGNLBCEJKMPQTUXYZWHOSAFRID | WHO'S AFRAID OF VIRGINIA WOOLF |
UVXYZTHELIONWRABCDFGJKMPQS | THE LION IN WINTER |
VWYZMURDEONTHIXPSABCFGJKLQ | MURDER ON THE ORIENT EXPRESS |
ZSTARWBCDEFGHIJKLMNOPQUVXY | STAR WARS |
OPQRSTUVWXYZALIENBCDFGHJKM | ALIEN |
GJKLPQSUVWXYZTHERMINAOBCDF | THE TERMINATOR |
FGHJKLMOPQRUVXYZWITNESABCD | WITNESS |
RUVWXYZTHESILNCOFAMBDGJKPQ | THE SILENCE OF THE LAMBS |
NFIDETBGHJKMPQRSUVWXYZLACO | LA CONFIDENTIAL |
ZMOULINRGEABCDFHJKPQSTVWXY | MOULIN ROUGE |
CFGHJKLOQTUVWXYZSPIDERMANB | SPIDERMAN |
MPQUVWXYZLOSTINRABCDEFGHJK | LOST IN TRANSLATION |
Here's a Ruby script to automate the decryption process. You'll also need to get the list of movies and the actors.list and actresses.list files from IMDB's text database.
3 Comments:
Interesting read! But it would be great if you could shed a little more light on the process than the actual solution. How did you start? How did you find the actual number by which you had to shift the movie titles? How did you know which movies you had to use? All brute force?
If you could shed a little light on that, it would be great.
sorry for posting anonymously, but I have no blogger account.
Veit (g o c u b s (a t) g m x . n e t)
Don't worry, I'll get to it. That's the topic of my next post ;)
Martin
I'm looking forward to it :)
Veit (g o c u b s (a t) g m x . n e t)
<< Home