Current location: Hot Scripts Forums » General Web Coding » JavaScript » JS Encryption THAT WORKS

JS Encryption THAT WORKS

Closed Thread
  #1 (permalink)  
Old 03-04-06, 06:51 PM
Newb-Man's Avatar
Newb-Man Newb-Man is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
JS Encryption THAT WORKS

I Dare ANYONE to try to get passed this JAVASCRIPT ENCRYPTED website. I know, everyone keeps flaming JS Encryption [and are mostly right] but this can work NO PROB.

this is the website
BEWARE...it is not just hexadecimal encrypted [hexadecimal encryption sucks but at times fools a small majority].
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #2 (permalink)  
Old 03-04-06, 08:53 PM
King Coder King Coder is offline
Community VIP
 
Join Date: Jan 2006
Posts: 703
Thanks: 0
Thanked 0 Times in 0 Posts
Who cares if the encryption works or not, it shows the password up in the URL... very unsafe.
__________________
my site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #3 (permalink)  
Old 03-04-06, 10:30 PM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,814
Thanks: 0
Thanked 0 Times in 0 Posts
First, you do have a serious problem. It's called Brute-Forcing!

Second, the SSS has 15kb of extra JS code that needs to be downloaded. Yes, it could be compressed and it's cached, but it's still code that has nothing to do with the function of the site. That might be a small price to pay for the extra security though.

Your encryption/decryption algorithm works very well, as would any algorithm of that sort. Hey, if I really wanted to protect my site, I could write an RSA encryption/decryption algorithm, but it would still be just as vulnerable to the oldest trick in the book: patience.
Anyone clever enough to break "normal" obfuscation techniques could also write a brute-force-routine and simply wait for the password to expose itself by decrypting the site. Sure, it would take time, but what's inside is probably worth it if somebody put a big padlock on it.
Once the code has been decrypted with the correct key, it's easily accessible via the DOM.
What differs your algorithm from the other ways of hiding source is that it's using a real encryption algorithm (it depends on a key to generate the cipher-text), while the other methods rely on obfuscation or encoding, which either uses no key, or has the key stored with the cipher-text.

I personally think encrypting/obfuscating/encoding clientside code is pretty pointless. What's so important on a site that you'd need to hide the sources? Site layouts and design features can be ripped/recreated simply by looking at the pages. Script functionality can also be recreated, even if it takes a while longer than copying/pasting the original code.

Usually, people try to hide code on public pages that don't require any type of logging in. If you only allow certain people to visit your secure pages, I hope you trust them not to rip your code since you trust them not to make the password public. (Which also would mean you need to re-encrypt all your encrypted pages!)

I know you already know this, I'm just stating it "for the record"
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #4 (permalink)  
Old 03-05-06, 06:35 PM
Newb-Man's Avatar
Newb-Man Newb-Man is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
by the way this is not my code, the credits are on the page

[just for the record]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #5 (permalink)  
Old 03-05-06, 08:32 PM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,814
Thanks: 0
Thanked 0 Times in 0 Posts
hehe, I calculated that it would take me 2 million years to brute-force an 8 character long encryption key. (Assuming the characters A-Za-z0-9_ are allowed)
That's with my own brute-forcer made in JS, capable of testing a whopping 4 passwords a second (when running locally).
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #6 (permalink)  
Old 05-28-06, 07:19 AM
jaxz jaxz is offline
Newbie Coder
 
Join Date: Feb 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Any tools for obfuscation?

How do I best use Obfuscation to "prevent"/slow down code-jacking of my javascripts?
What tools are useful for this?

And, the corollary, what tools do sneaky web masters use to decrypt such protected code?

Thanks,
Jaxz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #7 (permalink)  
Old 05-28-06, 07:21 PM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,814
Thanks: 0
Thanked 0 Times in 0 Posts
Jaxz, check the sticky thread in the JavaScript section.

It's not possible to decrypt the code since it is encoded using a hash, which is a one-way encryption method, unless you try every possible passphrase combination.¨

It is however overkill to do this kind of encryption and it's really a false sense of security.

To be able to use this particular method, you must hand out a password to each user who is allowed to view the site. Each time something changes on the site, it must be reencrypted with that exact password allow visitors to see updates.

But once a legitimate visitor has the password, he/she can also access the complete source code and rip it all anyway, just like if you had password protected the folder in which the sensitive files are. With the password, one can still copy everything so you'd have to keep a very close eye on who you let in.

If you don't want your scripts to be stolen, don't put them online. As soon as the script is downloaded to the client for excecution, he's got the whole source, no matter if you encrypted it or not.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #8 (permalink)  
Old 07-16-08, 02:14 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by TwoD View Post
hehe, I calculated that it would take me 2 million years to brute-force an 8 character long encryption key. (Assuming the characters A-Za-z0-9_ are allowed)
That's with my own brute-forcer made in JS, capable of testing a whopping 4 passwords a second (when running locally).
I was bored and reading some old threads, found this.
Was able to make my JS generate about 25000 strings per second, starting from aaaaaaaa to ________.
tested with 100 000 possibilities, stopped at aaaaaB3v which took 3959ms.
still it would take about 263½ years to go trough all 191 707 312 997 281 possibilities
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #9 (permalink)  
Old 07-16-08, 05:31 AM
Vicious's Avatar
Vicious Vicious is offline
Junior Code Guru
 
Join Date: Jan 2007
Location: Belgium
Posts: 584
Thanks: 0
Thanked 0 Times in 0 Posts
That's great, but please don't bump old threads
__________________
Jack Bauer makes Chuck Norris cry
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
  #10 (permalink)  
Old 07-16-08, 05:34 PM
TwoD TwoD is offline
Community Liaison
 
Join Date: Sep 2003
Location: 404
Posts: 1,814
Thanks: 0
Thanked 0 Times in 0 Posts
If I remember correctly, generating the strings wasn't the big time eater, actually testing the generated passwords was.

Oh, and what Vicious said
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 05:35 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.