I want to encrypt a string in Javascript and pass that string trough GET to PHP and decrypt that string in PHP.
How can I keep the string secret in Javascrpt?
For example I use CryptoJS crypt(message, secret_passphrase)
, how can I keep users away from viewing the secret passphrase with View Source?
I can't use any server side programming. I am using the Javascript code within a Sharepoint page, and server side programming would require Visual Studio. Actually I want to send an encrypted string from Sharepoint to PHP containing the current user's username so I can authenticate the user in PHP directly, without a login page (I decrypt it and compare it to some usernames in the MySQL datatbase, and if the username was found, I can proceed with the login).
I mentioned this so you can get the big picture of what I am doing.