chimly

03-13-2005, 06:16 AM

In doing some light-weight javascript math, a few of my calculations use stored constants, real or floating point numbers like "10.53" or whatever. Unfortunately, I've been informed that some of these values are considered slightly private and need to be hidden from folks who might browse through the source code.

(The values really aren't important... they are numbers about as exciting as how much I paid for gasoline, which the next driver can read off the pump and figure out I'm a wealthy guy who just spent 20 bucks; technically nobody's business.)

SOOOOO... Are there javascript encryption schemes that can be used to reference stored constants? Perhaps like:

y = f^sf&t67)e ;

----------------------

x = decrypt(y);

document.output_result.name0.value = 10 + x ;

Perhaps another solution is to store the numbers by their ascii values?? A clever surfer could figure them out, of course, but it might be sufficient for my purpose.

(The values really aren't important... they are numbers about as exciting as how much I paid for gasoline, which the next driver can read off the pump and figure out I'm a wealthy guy who just spent 20 bucks; technically nobody's business.)

SOOOOO... Are there javascript encryption schemes that can be used to reference stored constants? Perhaps like:

y = f^sf&t67)e ;

----------------------

x = decrypt(y);

document.output_result.name0.value = 10 + x ;

Perhaps another solution is to store the numbers by their ascii values?? A clever surfer could figure them out, of course, but it might be sufficient for my purpose.