protect js code

Discussion in 'JavaScript' started by 1ahosting, Dec 16, 2006.

  1. #1
    hi,
    What is the best method to protect javascript code? Maybe, some sort of encryption hard to brake. Are there any good softwares out there?

    Thanks in advance!!
     
    1ahosting, Dec 16, 2006 IP
  2. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #2
    There are none, theres is no way to hide your javascript or html from visitors, they are cleint side languages and no matter what they need to run on the users computer.

    Someone last night was selling an html encrypter, but it's not what they said it is,it's not possible, theres a free version of that on my site http://krakjoe.info that's about the best it gets for objusificating your code.
     
    krakjoe, Dec 17, 2006 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    To protect your javascript code you can obfuscate prior to send to clients.
    Here: http://dean.edwards.name/packer/ you can use an online obfuscator/compressor to check the look of results.

    I've tested on large javascript programs and not worked for me. Surely because my code is not properly written. ---> All statements on your code, including function declarations, must be correctly terminated with semi-colons.

    http://domapi.com/jscruncherpro/index.cfm sells another javascript obfuscator.

    At http://www.crockford.com/javascript/jsmin.html you can get a Minifier for javascript code. There are versions on C, Perl, PHP, Python, etc.
    Hope this help you.
     
    ajsa52, Dec 17, 2006 IP