Simple methods
Basic Method
BICM: Text 1
BICM: Text 2
Recursive Method
RICM: Text
Real world uses
Using playing cards to store hidden data:
The Implied Card Method for
Encoding Data Into Playing Cards.

Using the method without cards:

The Implied Method of hiding messages in packs of playing cards might not be particularly useful. It's a way of concealing short hidden messages and data, or performing very laborious magic tricks. However, the concept also lends itself to situations outside of the world of cards. The reason the Implied Card method works well with playing cards is because playing cards have a set order. Likewise, any group of items that has a set order can also have data encoded into it.


At its most basic, you could encode data into everyday numbers. An exact parallel to using cards would be using a list of the numbers 1 to 52. If we encode the data from the very first example (i.e. the 4-bit binary numbers 0001b up to 1111b, and then 0000b to 1010b), the resulting encoded numbers would look like this: 4, 7, 11, 12, 14, 18, 20, 22, 23, 26, 27, 28, 29, 33, 36, 37, 39, 41, 43, 44, 45, 46, 49, 50, 52, 1, 2, 3, 6, 8, 9, 10, 25, 32, 40, 42, 48, 15, 17, 21, 24, 34, 35, 38, 47, 16, 31, 51, 13, 30, 5, 19. [If we were doing this with cards, the cards would be: 4S, 7S, JS, QS, AC, 5C, 7C, 9C, 10C, KC, AH, 2H, 3H, 7H, 10H, JH, KH, 2D, 4D, 5D, 6D, 7D, 10D, JD, KD, AS, 2S, 3S, 6S, 8S, 9S, 10S, QC, 6H, AD, 3D, 9D, 2C, 4C, 8C, JC, 8H, 9H, QH, 8D, 3C, 5H, QD, KS, 4H, 5S, 6C].

The encoded numbers can be plotted on a graph to make it easier to visualise what is happening. The y-axis is the number; the x-axis is its new position after encoding:

Image: a graph showing encoded numbers

The original numbers used for the encoding don't have to be sequential -- they could be any list as long as they have a known (or previously agreed) set order without any repetition. For example, the list of prime numbers, the list of squares, the Fibonacci sequence ignoring the first 1, and so on.

If you wanted to have encryption, you could start with a randomly sorted list of numbers and encode the data into that. The main trouble with this is that it is considerably harder to get a genuinely random list of numbers than it is to just shuffle some cards. Shuffled cards would create an unpredictable, unreproducible one-time pad (or at least one where the odds of recreating it are 1 in the factorial of 52); computer generated random numbers are only as good as the algorithm used to create them, which may or may not have known, or as yet undiscovered, flaws.

Once we consider the Implied Card idea without cards, there is more freedom in what we can do. For example, we could use 1000 numbers instead of 52. For recursive encoding, we can now repeatedly use the number zero instead of being limited by having only two Jokers in a pack. If we ignore recursive encoding, we can use the number zero as a marker to indicate what would essentially be a second or third pack. For example, we could encode into multiple groups of 20 ordered numbers, and demarcate the groups with a zero. Such an encoding might resemble something like this when portrayed in a graph:

Image: a graph showing encoded numbers

Using numbers instead of cards allows the resulting encoded data to be altered further by other mathematical transformations, which means the data can be hidden and encrypted even more.

Other ordered objects:

Ignoring cards and numbers, the encoding method works with any objects that have a set order. As an example, we could use the letters of the alphabet: With the English alphabet, we could use 26 letters or 52 letters if we distinguish between upper and lower case. One point is that we don't have to use the whole alphabet (just like we never really needed to use a whole pack or a large quantity of numbers). If our message is short, we can use just a handful of letters.

If we encode the 16-bit binary string 1000 1001 1010 1111 into the first ten letters of the English alphabet, we end up with the letters "aehibdfgjc". (The number equivalent from 0 to 9 would be: 0, 4, 7, 8, 1, 3, 5, 6, 9, 2).

To show how abstract the encoding method can become when picking ordered objects to use, here are some other examples:

Kings and Queens of England ordered by date: From 1066 the first ten monarchs of England, sorted by date, are as follows: William I, William II, Henry I, Stephen, Henry II, Richard I, John, Henry III, Edward I, Edward II.

Our 16-bit number (1000 1001 1010 1111) encoded into their names is as follows: William I, Henry II, Henry III, Edward I, William II, Stephen, Richard I, John, Edward II, Henry I.

Characters from The Simpsons: Supposing you took a group of Simpsons characters and sorted them alphabetically by first name, you could then an encode a number into that too. We'll start with: Apu, Bart, Homer, Krusty the Clown, Lisa, Maggie, Marge, Nelson, Otto, Troy McClure.

Our number encoded into their names is as follows: Apu, Lisa, Nelson, Otto, Bart, Krusty, Maggie, Marge, Troy, Homer. We could create a drawing of them standing in line that contained the message. We could also have ordered them by height or age.

Piles of coins: A pile of coins containing our binary number:

Image: stacks of coins arranged to contain data

An English sentence: We can encode into sentences where the distinguishing feature is the length of the words. The downside to this is that we are limited by the scarcity of particularly long words in English, although ways around this could be created. Our 16-bit binary number is contained in this perfectly normal English sentence: "I stand unwisely squeaking by this hungry, dancing fairground cat". Alternatively, the distinguishing feature could instead be based around the alphabetical order of the words in the sentence: "A fairground mouse never amuses everyone it jokes to anyway". Doing this allows many more words to be used for the encoding.

For shorter messages, it becomes apparent that the ordered objects wouldn't need to be specifically moved to fit the encoding, but could be found already in the order that matched the required encoding. In this way an old photograph of, say, differently sized mountains could be chosen to match a brand new encoded message. Likewise, a portion of already existing text from a book could be used.

Decoding as a pastime

In a way, every existing set of ordered entities can be decoded to find a "message" using the same method we decoded the data in the playing cards. The message will of course be a result of random chance and so won't have any real meaning, but there could be a pastime in "decoding" words and objects in much the same way that people search for anagrams. A lot of the time the decoded message won't be of any interest at all, but sometimes it might produce something apt or interesting.

As a (not very good) example, take the word "mouse". We can "decode" it by first writing out the letters in alphabetical order in a row at the top of a piece of paper: "e m o s u", we then go through the row marking 0s for letters that don't appear in order, and 1s for letters that do. When we get to the end of the row, we create a new row underneath consisting of the letters marked with 0s in the first row, and we continue marking and creating rows until we are done.

Image: decoding the word 'mouse'

After decoding, we read off the binary numbers to reveal 0110 1011 (0x6b in hex), which happens to be the ASCII code for the letter "k". Of course in this case the result is completely meaningless and not that interesting, however there will be some words, or sequences of words, that create interesting solutions.


So that's my method for storing and encrypting data into a pack of cards. It might not be useful in everyday life, but I could see that it has its uses at times. Even if there is no point to it at all, it's still a fun puzzle to play with.

Tim Warriner, 2nd March, 2014.
[Minor edits, July 2015, July 2016]

Previous page    Main page

Image: Contact information