Live data from Hacker News

Hiding messages in a deck playing cards

asherfalcon.com

1–10 of 42 posts

Re: Hiding messages in a deck playing cards

#2
Hey all, I found a cool way to convert text into a specific order of a deck of playing cards. I detailed the instructions of how it works in the blog post but a brief overview would be that it uses Lehmer codes which allow you to uniquely identify each permutation of a set i.e. each of the many many ways a deck of cards can be shuffled/arranged

Re: Hiding messages in a deck playing cards

#4
Despite appearing to have perfectly ordinary structured static HTML content (aside from the fact that it spams things like instead of using some basic CSS properly), without JavaScript I only see a solid-colour background.

Anyway, this doesn't offer a whole lot of storage:

  $ python -c 'print(sum(__import__("math").log2(x) for x in range(1, 53)) // 8)'
  28.0

Re: Hiding messages in a deck playing cards

#7
post #4

Despite appearing to have perfectly ordinary structured static HTML content (aside from the fact that it spams things like instead of using some basic CSS properly), without JavaScript I only see a solid-colour background. Anyway, this doesn't offer a whole lot of storage: $ python -c 'print(sum(__import__("math").log2(x) for x in range(1, 53)) // 8)' 28.0

https://deckcrypt.github.io/

45 characters according to the blog post and this demo

Re: Hiding messages in a deck playing cards

#8
post #2

Hey all, I found a cool way to convert text into a specific order of a deck of playing cards. I detailed the instructions of how it works in the blog post but a brief overview would be that it uses Lehmer codes which allow you to uniquely identify each permutation of a set i.e. each of the many many ways a deck of cards can be shuffled/arranged

TIL about Lehmer codes... and "poker encoding" ;)

(I just prefer poker to solitaire...)

Someone else mentioned that the orientation of the cards (up or down) and possibly even the front-back facingness of the card (facing up, facing down) would add another 2 possible bits to the available encoding space. (Of course, at that point you'd have to also encode which side of the whole deck is the "top"...)

My own thought was to add par2 to make it robust against small errors... at the cost of some transmission space!

Re: Hiding messages in a deck playing cards

#10
Good stuff. You could get much better bandwidth than this by tokenizing and using something like a Huffman or arithmetic code on token frequencies. As a simple example, if you set your tokens to be all English words - let's say there are between 500k and 1 million - that's about 9-10 bits per word. I am sure you could do much better than this as well
Post reply on HN