Skip to content

Instantly share code, notes, and snippets.

@losvedir
Created February 15, 2011 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save losvedir/828496 to your computer and use it in GitHub Desktop.
Save losvedir/828496 to your computer and use it in GitHub Desktop.
Breaking Wilhelm von Hackensplat's Vinegar cipher
From HN thread here: http://news.ycombinator.com/item?id=2222228
Challenge posed here: http://blog.hackensplat.com/2011/02/vinegar.html
It seems the cipher is an application of viginere four times. So, if the original
17 character key is x1 x2 y1 y2 y3 z1 z2 z3 z4 z5 t1 t2 t3 t4 t5 t6 t7, and the
original text is C1 C2 C3 C4, then the ciphertext we're given of IWY SEIX....
can be thought of as follows:
I = (C1+x1+y1+z1+t1)
W = (C2+x2+y2+z2+t2)
Y = (C3+x1+y3+z3+t3)
S = (C4+x2+y1+z4+t4)
and so on.
My initial idea on how to break this is through some combination of addition and
subtraction of the letters we're given to eliminate the various x's, y's, z's, and t's.
For instance, at some point we'll have a ciphered letter N, such that
N = (Cn+x2+y1+z1+t1). Then I-N = C1-Cn+x1-x2, and the y's, z's, and t's are eliminated.
Come to think of it, any letter should be able to be subtracted out that way such
that you're always left with an x1-x2, which can be thought of as a viginere letter itself.
I think that's most of the way there. Would have to think a bit more to finish it
off. And much more work to actually crack the little code given on the page. Just
wanted to get this out there as I thought of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment