r/codebreaking • u/The_Lost_Prince • Aug 05 '19
JavaScript Enciphered Text
Hello, fine codebreakers of Reddit! This is my last resort, so I do hope you can help.
I'm a recreational internet historian, and I've been studying a particular web of mysterious blogs for the last year. I have come to the climax of one of its puzzles, but I am blocked from seeing this last bit of text by a JavaScript encryption program. I've been trying for months to solve the puzzle the way I think it was intended with no avail. Y'all are my last hope.
In the source code I can see the enciphered text and the key that Java uses to encipher/decipher it. Here is the code I am trying to break. Thank you very much for your consideration:
id="33A3wYYb" title="U2FsdGVkX1+VJdZdO0+ljNoQyP58scIsEjFB8H72LYBALkC6PFfYPoln8RTbiRrE"> <a href="javascript:decryptText('33A3wYYb')">Show encrypted text
1
u/spacenerd-roadkill Aug 06 '19
So JavaScript, although available to read through, can get complicated if you have a ton of JavaScript files and references. The easiest way would be to view the page source, and then start going through the code, or the referenced JS files.
You’ll want to find a function called “decryptText” and then start to go from there. Even though some of the files might be minified, or compressed, you should be able to still do a search if you drill in to the files far enough.
If you provide the url, I might be able to help.
2
u/jtm297 Aug 06 '19
You might know all this already, but it's almost certainly using this: http://www.vincentcheung.ca/jsencryption/
To be able to convert that title into plain text you need the original key it was encrypted with. The only option I currently see is writing some JavaScript to bruteforce the key. Even this approach may not work, but there is a good chance that they used the random button to generate the key, which means it is only 8 characters alphanumeric (upper+lower). Now if you tap into using your GPU through the browser, you'll likely crack the key pretty quickly. They could have however used a different key for each title. A lot of the operations that were done to create the final result are irreversible, such as bitwise operations. You can see the code used for the encryption here: http://www.vincentcheung.ca/jsencryption/jsencryption.js
I could look into cracking the key for that. Maybe they used something obvious. Maybe not. However, I would suggest doing a bruteforce approach using this website and the console in Chrome. Sorry to be the bearer of bad news.