!
A Tale of 2 Secrets › Forums › T.E.M.P.E.S.T. › !
Tagged: help
- This topic has 79 replies, 13 voices, and was last updated 3 weeks, 2 days ago by _hacker_.
-
AuthorPosts
-
20th November 2025 at 1:58 pm #113693BobDParticipant
The problem with the simple method of ‘hill climbing’ as described by Crackerjack_404 is that it may lead you up the wrong ‘hill’! The ‘simulated annealing’ modification where, at least to start with, a change can be accepted even though it does not offer an improvement or even seems to give a poorer yield, will prevent the program heading to a false ‘peak’. The Wikipedia page on the subject gives a comprehensive description of the technique. Several of my students have used this technique to solve various Challenges in the past, especially those involving substitution ciphers. I usually find approximately 1500 iterations are needed in these cases.
20th November 2025 at 3:24 pm #113728Crackerjack_404Participant@BobD
Thank you for mentioning that! I also struggled with it getting stuck at the local maxima (‘wrong hill’) in the past and wrote up an annealing algorithm for later ciphers, and like you said, it’s very useful for substitution ciphers like the playfair. I found that the Wikipedia page has a lot of information, but in terms of implementing Cowan’s, ‘Breaking Short Playfair Ciphers with the Simulated Annealing Algorithm’ might be a useful read for anyone interested in simulated annealing!
20th November 2025 at 11:17 pm #113782Gen_ruiktParticipantJust to make this forum even more nerdy anybody heard of Kryptos particularly k4
If u have not here it is:
OBKRUOXOGHULBSOLIFBBWFLRVQQPRNGKSSOTWTQSJQSSEKZZWATJKLUDIAWINFBNYPVTTMZFPKWGDKZXTJCDIGKUHUAUEKCARBasically from what I know it has not been solved for a few decades the rest of kryptos has k1-3 and wouldn’t it be really funny if in the downtime between challenges we as a group solved it. There are loads of videos with backstory on Kryptos if anybody wants it.
There have been hints about berlin clock and east north east whatever they are hinting at (they are some of the letters I forgot where they go in the cipher text) but should we give it a go at solving it?K1-K3 text with a little information about the text
“BETWEEN SUBTLE SHADING AND THE ABSENCE OF LIGHT LIES THE NUANCE OF IQLUSION.”: (Note the misspelling of “illusion”)
“IT WAS TOTALLY INVISIBLE HOWS THAT POSSIBLE? THEY USED THE EARTHS MAGNETIC FIELD X THE INFORMATION WAS GATHERED AND TRANSMITTED UNDERGRUUND TO AN UNKNOWN LOCATION X DOES LANGLEY KNOW ABOUT THIS? THEY SHOULD IT’S BURIED OUT THERE SOMEWHERE X WHO KNOWS THE EXACT LOCATION? ONLY WW THIS WAS HIS LAST MESSAGE X THIRTY EIGHT DEGREES FIFTY SEVEN MINUTES SIX POINT FIVE SECONDS NORTH SEVENTY SEVEN DEGREES EIGHT MINUTES FORTY FOUR SECONDS WEST ID BY ROWS”: (includes a misspelling of “underground” and latitude/longitude coordinates for the CIA headquarters)
“SLOWLY DESPARATLY SLOWLY THE REMAINS OF PASSAGE DEBRIS THAT ENCUMBERED THE LOWER PART OF THE DOORWAY WAS REMOVED WITH TREMBLING HANDS I MADE A TINY BREACH IN THE UPPER LEFTHAND CORNER AND THEN WIDENING THE HOLE A LITTLE I INSERTED THE CANDLE AND PEERED IN THE HOT AIR ESCAPING FROM THE CHAMBER CAUSED THE FLAME TO FLICKER BUT PRESENTLY DETAILS OF THE ROOM WITHIN EMERGED FROM THE MIST”: (a quote from Howard Carter’s diary about opening Tutankhamun’s tomb)
21st November 2025 at 9:20 am #113784ha_ha_i_fooled_you_my_name_never_changed_ha_haParticipantHi,
If anyone is having trouble with #113625, it may be because the description of the cipher is backwards. The shifts were applied BEFORE the hill cipher. What is likely to have happened is that an intern hit the “DECRYPT” button by mistake when generating the ciphertext. I.e., this is what happened:
plaintext → Vigenère cipher (keylength 3) → Hill cipher (3×3) → ciphertext
To decrypt:
ciphertext → inverse Hill cipher → inverse Vigenère cipher → plaintext
Due to the fact that the modulus, 28, has many small factors, the effect of the shift can sometimes be wiped out by the Hill cipher. So it might /look/ like parts of it were encrypted the right way round.
So, @upsidedown, before I attempt #113626, I would please like to see the code you used to generate its ciphertext.
Thank you for that, and for the challenges.26th November 2025 at 11:44 am #113912GREENcarParticipantHarry in one of his earlier posts talked about K4.
https://www.scientificamerican.com/article/a-solution-to-the-cias-kryptos-code-is-found-after-35-years/
This solution feels a lot like cheating…26th November 2025 at 11:44 am #113911GREENcarParticipantHello everyone, as referenced on this topic and many others, the IoC for English is 0.065-0.067. But when I put the frequencies of all the English letters into my IoC-calculating spreadsheet, the IoC comes out as closer to 0.060. Anyone know why?
Might be hard for anyone to say why without looking at the text and the spreadsheet! Harry
26th November 2025 at 6:17 pm #113928upsidedownParticipant@GREENcar
I have counted the letters in your post and computed this tabulation:
A B C D E F G H I K L M N O P Q R S T U V W Y 9 1 10 3 27 4 3 12 12 1 10 3 14 17 3 1 9 13 16 5 1 3 5Here are IoC values, rounded to four decimal places, computed from portions of the above letter frequencies (e.g. A,B,C means I computed the IoC of your message after removing all letters that are not A, B, or C):
A: 1.0000 A,B: 0.8000 A,B,C: 0.4263 A,B,...,G: 0.2782 A,B,...,M: 0.1398 A,B,...,Y: 0.0675I suggest that you test your spreadsheet on each of these cases until you find one that differs (hopefully early on). You can then try to compute the same value by hand (with the aid of a calculator) and see what’s gone wrong.
28th November 2025 at 2:11 pm #113962Gen_ruiktParticipantVigenere ciphers are fun lol like cribbing them from past letters and then using kasiki to work out length to the just guess words that could fit
i like vigenere ciphers 🙂
can anybody put any other ciphers in here that we could have a go at like vigenere or something like that pls and thx1st December 2025 at 10:39 pm #113988TParticipantAs mentioned in:
https://www.southampton.ac.uk/~wright/1001/Notes.pdf
Section 9.4
I’ve written a program that uses all the different techniques used in that chapter, however specific to Vigenere ciphers I use the ASINTOER frequency analysis method – running the program prints to the terminal a table of 26 columns and lots of rows (n rows for each keyword length of n).
Although it isn’t guaranteed to work every time, usually you can just read off the letters that make up the keyword and if it makes sense then it is probably correct, then you just need to edit a program to decode the text using the keyword.1st December 2025 at 10:47 pm #114016_hacker_Participant@the_cryptographer_formerly_known_as_madness
why wont this code to hill-climb for the playfair cipher work???
Not sure you can expect Madness to have time to debug your code!! And if you do you might think twice about prodding the sleeping bear. Harry
Update: we had a little trouble with forum post formatting because of errors the html below, so have had to cut the content, sorry. Harry
3rd December 2025 at 11:26 pm #114105Gen_ruiktParticipantHi is anybody able to break down the playfair cipher im barely understanding the deciphering process
4th December 2025 at 11:10 am #114111Puzzling_PelicanParticipant@_hacker_
I had a quick look at your code and believe the most likely reason it gets stuck is the mutate key function. Swapping letters is not always enough for playfair, my tool has over 10 different operations it can perform on the key. Try come up with a few mutations you can do to the grid (Madness’ book mentions a few but not all).
You might also want to experiment with temperature and probabilities to find which work best (maybe even a hill climbing algorithm to optimise your hill climbing algorithm).
Sorry I can’t provide much more information, Harry is (rightfully) enforcing the “all my own work” rule and this post needs to get through moderation.@Gen_ruikt
Have a look at unit 70 in Madness’ book, it does a great job at explaining it, there are also other materials online.
The short answer is that letters on the grid are treated as corners of a rectangle and the other 2 corners are the encrypted pair (the text is encrypted in groups of 2 at a time).4th December 2025 at 12:31 pm #114119Crackerjack_404Participant@Gen_ruikt
Playfair is a digraph substitution cipher, so everything happens two letters at a time rather than one. The method is completely symmetric so the encryption and decryption rules are the same except for the direction you move in the grid.
To simplify the explanation of the decryption, let’s assume we know the grid used for encryption. Courtesy of Madness’ cipher challenge archive, here’s an example from 2001 Challenge 5.
Section of ciphertext: NZTFM YKDID MYLCY NSGZ
The 5×5 polybius square used is:
G O L D E
N J U B I
A C F H K
M P Q R S
T V W X YSince the alphabet has 26 letters but the grid has only 25 spaces, one letter must be removed or merged. Here, Z is omitted, so all Z’s in the ciphertext must be replaced with Y’s. Some variants merge I/J instead. Doesn’t matter which letter you omit, the important thing is consistency
To decrypt, we first the ciphertext in pairs:
NZ TF MY KD ID MY LC YN SG Z…
Then for each pair, apply exactly one of the three rules:
both letters on the same row – move one step to the left for decryption (encryption moves right, so decryption moves left).
Both letters are in the same column – move one step up for decryption (encryption moves down, so decryption moves up).
Both letters form the corners of a rectangle – swap them by taking the letters in the same row but the other column.
So taking our first pair: NZ, notice its (row, col) position:
N is (2,1) and Z is replaced with a Y, which is in (5,5).
This forms a rectangle, so we take the letters which are in the same row but other column, namely the positions (2,5) and (5,1), corresponding to: “IT”
NZ -> ITThe next pair: TF
T is (5,1) and F is (3,3)
This forms a rectangle again, so we take the letters in positions (5,3) and (3,1), corresponding to “WA”
TF -> WA… and so on…
MY -> ST
KD -> HE
ID -> BE
…
once you do this, the start of the plaintext string should read: “ITWASTHEBESTOFTIMES”Does this make sense? Do ask if something still feels confusing or if you’re unsure about it.
In terms of implementing an attack to break this ciphertext, I’d suggest you look at hill climbing or simulated annealing in Madness book
4th December 2025 at 3:08 pm #114106ha_ha_i_fooled_you_my_name_never_changed_ha_haParticipant@_hacker_,
My first complaint is that the code for ngram_fitness() is not provided. I tried to substitute with my code for party_planning(), but got lots of run-time errors.
My second observation is that your code is the simulated annealing algorithm from that article by Cowan. In that article, he states that the program needs to be run several times before finding the global maximum. Have you tried turning it off and back on again? My algorithm in Unit 106 of version 2 of my book is slightly different, and could be described as “churning” by a guy who wrote a page on the internet but the page is now gone (CryptoDen). It usually does not need to be restarted.@Gen_ruikt, what have you read about it so far?
4th December 2025 at 3:40 pm #114127TParticipantoops I think I accidentally submitted my answer to 8a on the forum – good job it is moderated!
Don’t worry, we caught it, but we are still a little baffled about how you managed that! Can you get back to us so we can reduce the likelihood of a repeat by someone! Thanks, Harry
-
AuthorPosts
- You must be logged in to reply to this topic.