Avatar of steva
steva

asked on 

Any way for Javascript to sense that it's been deminified?

Is there any way to sense that your code is running deminified, because some has turned on  something like the JS Deminifier extension in Firefox?  You might then abort to try to keep people from trying to reverse engineer your product.  I'm thinking maybe there's some action you can take that behaves differently in minified and demilnified code.  One thing that will be different is the timing. If the browser has to stop and deminify something before continuing you could possibly force a script to fail because some script it needs  hasn't loaded yet.  Just wondering if anyone has thought this through as a possible way to protect their code.

Thanks
JavaScript

Avatar of undefined
Last Comment
steva
Avatar of leakim971
leakim971
Flag of Guadeloupe image

so the hacker just need to locate your code checking the timing and remove it ?
;-)
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Are you aware you can run javascript on server side?
http://www.youtube.com/watch?v=bzCnUXEvF84

the only place where your code << can't >> be stolen..
Avatar of steva
steva

ASKER

Leakim,
so the hacker just need to locate your code checking the timing and remove it ?
Well, there wouldn't actually be code that checked the timing. You might write something that needed jQuery, for example,  but because of the time to deminify something first, the jQuery hasn't loaded by the time it's needed so the code that expects it hits an undefined error. There's no clue that you did something to cause that error or what to change in 10,000 lines of JavaScript to fix it, assuming you have something that will let you modify loaded JavaScript. (Is there such a thing?)

Dave,
There are many resources that can take your code and 'de-minify' it when it is not running.

Yes, but the real progress in reverse engineering comes when you can run deminified code, stepping through the code and watching how the variables change.  I'd like to prevent that.

I know 100% protection is not possible.  I'd just like to make it 10X harder than if I do nothing.
Avatar of steva
steva

ASKER

Leakim,
I didn't see your second post when I posted the above. It may be possible to run JavaScript on the server, but if the JavaScript's main job is to manipulate the client's screen through the DOM, it seems that that code has to be in the client.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You can't prevent people from decoding and running your code.  It's just a matter of time and resources.  You can protect it from the people like me who are too lazy to decode it but more serious coders and hackers probably won't have any trouble figuring it out.

Besides, what makes it worth stealing?  Generally, you'd be better off spending your time making things that earn money.
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of steva
steva

ASKER

Ok, let's close this out.  I just thought I'd throw out the idea and see what came back.

Thanks.
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo