Lock or compress javascript .js files

Discussion in 'JavaScript' started by wdstuff54, Dec 25, 2007.

  1. #1
    Hey -

    Several times I've come across .js files that when I tried to open them they said they were compressed archive or something along those lines and could not be opened.

    I have a javascript file I would like to lock in such a way.

    Any ideas?

    Thanks & Happy Holidays!
     
    wdstuff54, Dec 25, 2007 IP
  2. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I am interested too. Any updates on this?
     
    picobello, Dec 25, 2007 IP
  3. locdev

    locdev Active Member

    Messages:
    171
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #3
    you can't lock js file
    all you can do is obfuscate and make it hard to read or use.

    There many js obfuscators some of them are open source

    I use one from
    saltstorm.net
     
    locdev, Dec 25, 2007 IP
  4. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Thanks locdev

    Is it the best obfuscator? (saltstorm.net)
     
    picobello, Dec 25, 2007 IP
  5. locdev

    locdev Active Member

    Messages:
    171
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #5
    No I don't think it is the best but good to start with.
     
    locdev, Dec 25, 2007 IP
  6. temp2

    temp2 Well-Known Member

    Messages:
    1,231
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    150
    Digital Goods:
    2
    #6
    encrypt/encode it, by soft or by here :D
     
    temp2, Dec 26, 2007 IP
    picobello likes this.
  7. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #7
    Good tool; thanks for the link temp2; rep added
     
    picobello, Dec 26, 2007 IP
  8. instruite

    instruite Well-Known Member

    Messages:
    526
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #8
    instruite, Dec 26, 2007 IP
  9. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #9
    MMJ, Dec 26, 2007 IP
  10. wdstuff54

    wdstuff54 Well-Known Member

    Messages:
    639
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    110
    #10
    Thanks for all the posts. Very helpful. Anyone know why some .js files say they are compressed archives and can't be opened?
     
    wdstuff54, Dec 27, 2007 IP
  11. jronmo

    jronmo Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I'm curious whether the compressed js file is decompressed in the browser's cache. It seems to be used for transport across the network.
     
    jronmo, Dec 27, 2007 IP
  12. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #12
    What do you mean?

    @wdstuff54:

    Got an example?
     
    MMJ, Dec 28, 2007 IP
  13. jronmo

    jronmo Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I was wondering if browsers had built in decoding mechanisms to read compressed/obfuscated text or it was just rendered as the original code once it was rendered into cache. Or does javascript have a built-in decrypting mechanism similar to the way an MD5 hash works.
     
    jronmo, Dec 28, 2007 IP
  14. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Obfuscated text is just obfuscated for the human eye, to the computer its all the same.
     
    MMJ, Dec 28, 2007 IP
  15. locdev

    locdev Active Member

    Messages:
    171
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #15
    actually you can compress js files with gzip but it doesn't chnages or hides file contents
     
    locdev, Dec 30, 2007 IP