Can You Solve GCHQ Xmas Puzzle?
Written by Mike James
Wednesday, 23 December 2015

It seems that government security agencies like to set puzzles for us geeks to solve. The motive might be recruitment, but it is still fun trying to solve them even if you don't want a job as a spook.

This year the UK communications agency GCHQ has been sending a "traditional" xmas card from the director that includes a not so traditional puzzle. If you can solve the puzzle it leads on to other puzzles:

"Once all stages have been unlocked and completed successfully, players are invited to submit their answer via a given GCHQ email address by 31 January 2016. The winner will then be drawn from all the successful entries and notified soon after."

The card, which also asks for donations to the UK children's charity NSPCC, is only being sent out to people on the director's xmas card list, but the rest of us can access the puzzle on the website.

The problem is an interesting one as it takes the form of an inverse, or tomographic, reconstruction. Such puzzles are reasonably well known and Wikipedia suggests that they are called Nonograms, Hanjie, Picross or Griddlers.

The basic idea is that you have a 2D grid and along the rows and columns are lists of numbers that give how many runs of each length there are in the row and column. For example a row with 2, 4, 5 next to it would have three runs consisting of a run of 2, a run of 4 and a run of 5 black cells. Obviously a single row or column doesn't specify where the runs are but if you are given the information for all of the rows and columns you can see that a unique solution which satisfies all of the constraints might exist. If a unique solution doesn't exist then you can fix which one you want by providing some of the starting values.

Notice that this is similar to the inverse problem encountered in tomography where you can measure the absorption of a beam, usually X-rays, in a range of positions and have to work out the 2D arrangement of absorbers that could produce the pattern.

The GCHQ problem can be seen below:

Before you start to ponder the problem manually I should point out that there are some fairly obvious programming approaches to the task, but you already knew that didn't you.

When you get it right the image is a QR code that leads you to the second part, which is a sequence of multiple choice questions.

So start coding and see what you can come up with.

A Christmas card with a cryptographic twist

#### Related Articles

GCHQ Open Sources Gaffer

UK Launches Games Portal To Discover Cyber Security Talent

Alan Turing Institute Starts Work

GCHQ Builds A Raspberry Pi Cluster

Cryptoy - Code-Making App From GCHQ

GCHQ Challenges Hackers To Crack Cryptic Codes

 DARPA Wants All C Converted To Rust07/08/2024This sounds like a good idea, but is it really? The idea that the language that code is expressed in can make it better is a subtle one and this might just have escaped the DARPA bosses. + Full Story Python Strengthens Its Dominance Of TIOBE Index05/08/2024The August 2024 Edition of the TIOBE Index has been published and Python, which has now continuously occupied the top position for 15 months since June 2023, looks set to become the most popular progr [ ... ] + Full Story More News