3 ms·
vg vf cbffvoyr gb qrgrezvar gur vqragvgvrf bs gur guerr tbqf jvgubhg xabjvat juvpu jnl ebhaq wn naq qn ner. (r.t. guvax nobhg ubj gb qb guvf jvgu whfg gur Gehr
by shoo 13y ago
vg vf cbffvoyr gb qrgrezvar gur vqragvgvrf bs gur guerr tbqf jvgubhg xabjvat juvpu jnl ebhaq wn naq qn ner. (r.t. guvax nobhg ubj gb qb guvf jvgu whfg gur Gehr naq Snyfr tbqf, vtabevat Enaqbz)
gur dhrfgvbaf lbh ner nfxvat va trareny fubhyq punatr qrcraqvat ba gur bofreirq qn|wn nafjref gb gur cerivbhf dhrfgvbaf. n fgengrtl pna or n gerr bs dhrfgvbaf, abg n frdhrapr svkrq va nqinapr.
gur uneq ovg vf vfbyngvat gur enaqbz tbq sebz gur bgure gjb tbqf. abgr gung gur enaqbz tbq qbrf abg enaqbzyl rzvg lrf be ab (rapbqrq nf wn<->qn), vg enaqbzyl nafjref gur tvira dhrfgvba rvgure gehgushyyl be snyfryl. fb lbh pna senzr n fhvgnoyl pbagbegrq dhrfgvba gung sbeprf gur fnzr erfcbafr sebz gur enaqbz tbq va obgu gehgul-zbqr naq snyfrl-zbqr, gung qvfgvathvfurf vg sebz gur aba-enaqbz tbqf...
- ColinWright 13y agoApropos of nothing in particular ... Not bothering to use ROT13, I just dropped that into my generic substitution cipher decoder and it spat out the answer almost immediately - quite pleased with that.
- javajosh 13y agoInteresting. You cycle through substitutions and match against a dictionary to detect a hit?
- ColinWright 13y agoNope, I use the shotgun stochastic hill-climbing algorithm I wrote for something else, with the ballistic option disabled. In short: While True: Generate a random key "Decode" Score Start timer While timer not expired: Perturb the key Score If better: Keep the new key Reset timer Print decrypt In this case the first output was completely readable.
- GhotiFish 13y agoI have no idea how you'd make a scoring system that worked well with a hill climbing algorithm. You could check each word for a match in the dictionary, but with a substitution cipher you could essentially turn one word into any other word of the same length (excluding words with the same letter in them). Without a way to check for "close" words, you wouldn't be able to climb the hill. would "pello" score a 0.7 and "hello" a 1? I can't think of a fast way to get that number. I'd like to try my own hand at this, but the way I'm thinking of making the fitness function doesn't seem like it would be smooth enough. What did you do?
- ColinWright 13y agoTake a frequency chart of all trigrams in English, and take the vector product of the frequency in the decrypt with the frequency in English. So, let E(t) be the frequency of occurrence of the trigram t in English, d(t) be how often it occurs in the decrypted text, and compute: Score = sum( [ E(t)*d(t) for t in decrypt ] ) If common trigrams turn up frequently in the decrypt, this will be "large". If uncommon trigrams turn up frequently, this will be "small".
- GhotiFish 13y ago... that is a really good idea... Turns out there's also a fair amount of data to use as well. http://www.cse.chalmers.se/edu/year/2010/course/TDA351/ass1/en_stat.html http://www.cse.chalmers.se/edu/year/2010/course/TDA351/ass1/... I was thinking too rigidly. Thanks!
- ColinWright 13y agoNorvig has made n-gram data available: http://norvig.com/ngrams/ http://norvig.com/ngrams/
- just2n 13y agoWhy not use a residual sum of squares here? https://en.wikipedia.org/wiki/Residual_sum_of_squares https://en.wikipedia.org/wiki/Residual_sum_of_squares