We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Encrypt a javascript/url variable with a coldfusion function

Medium Priority
461 Views
Last Modified: 2013-12-20
I have a page that passes information to another file which inserts that info into a DB via url variable.  the url variable is passed to the page that does the insert/update asynchronously using javascript.   What i would liek to do is enrypt that url variable before it gets sent via the ajax call.  I am hoping that there is a) a javascript function that can act liek the cf encrypt() function or b use wddx somehow to pass the information between js and cf before being sent via the url.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
are you trying to obscure the url value or simply trying to encrypt the ajax call?

If you are passing sensitive data via ajax just use https instead of http in the script call
here's a javascript function you can do that does a type of encryption... I don't believe there is a built in function like CF has..

http://javascript.internet.com/passwords/xor-encryption4.html
here's another javascript string encryption method, bit better than the previous...

http://pajhome.org.uk/crypt/md5/

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
i think what i will have to do is create or use an existing javascript function to encrypt the url variable before it is passed then on the page that processes it ieither use a ajvascript function to decrypt it or write a small java program to do the decrytion and call that with CF
thanks for th einiput
Glad I could help! And good luck, let us know if you have any more questions...

Thanks,
~trail
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.