0

I am trying to decrypt the encrypted page source of an HTML file. I am serching for a decoding trick to decrypt a page containing facebook interface UI. It is in the following post decrypted facebook Ui page. The demo page of that post is encrypted. Is there any posible way to decrypt it?

Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
Saru Nathan
  • 140
  • 2
  • 11
  • 1
    As I say to my teenaged daughter, "Would you care to rephrase that as a polite question?" (_Ask_ for help, don't _tell_ us to help.) – nnnnnn Sep 13 '11 at 03:28
  • Inspect it with Firebug or Chrome Inspector and just copy the generated HTML. – Blender Sep 13 '11 at 03:30

2 Answers2

0

The code looks like this:

document.write(unescape("..."));

Copy the unescape("...") part. Go to JSFiddle. In the JavaScript area, type alert(, paste, and then type );. Press run.

The "encrypted" (not) source will be alerted. You can copy and paste that into your text editor of choice to start analyzing it.

By the way, the decrypted code looks pretty bad. I wouldn't want to learn from that.

icktoofay
  • 126,289
  • 21
  • 250
  • 231
0

You can't "decrypt" it back to the original source at this point. It is "obfuscated" to the point it's not really easy to read anymore.

You can deminify it to make it a little easier to read by using a JavaScript deminifer/deobfuscator as discussed in the SO question Is there such a thing as a javascript deminifier (deobfuscator)? JS Beautifier is one good one.

You could also use a debugger like a browser plugin like Firebug (though it doesn't deobfuscate/deminify without plugins) or use the latest version of Google Chrome which provides one built-in. In Chrome:

  1. Visit the page that has the script you are trying to view
  2. Press F12 to bring up the developer tools
  3. Go to the Scripts tab
  4. Choose the JavaScript file to view from the drop-down list in the top left
  5. Click the "brackets" icon in the bottom left to run the "Pretty print" tool which will make the script easier to read.

This still won't make it very easy to read since the author has obfuscated it pretty good. You're going to have to walk through it line by line and rebuild the script yourself if you want to go through all that trouble.

Community
  • 1
  • 1
Jon Adams
  • 24,464
  • 18
  • 82
  • 120
  • The question was referencing the demo page from the linked page. If you view source on that, it's "encrypted" (not really). Once you undo that protection, there is no minification or obfuscation at all. – icktoofay Sep 13 '11 at 03:44
  • @icktoofay: Ah, that makes more sense, thanks. Edited my answer with that in mind. So no, it isn't _encrypted_, but the demo page source is _obfuscated_ to the point it doesn't resemble the original source at all. – Jon Adams Sep 13 '11 at 03:50