Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
-3
rated 0 times [  2] [ 5]  / answers: 1 / hits: 86743  / 11 Years ago, wed, november 6, 2013, 12:00:00

Before anyone jumps in and says, Oh!! that's a bad idea, I know it is.



I want to keep both the key and value in the query string to be not easily visible to the end user.
I have something like this google.com/?category=textile&user=user1
I need to make it unintelligible like this: google.com/?kasjdhfkashasdfsf32423



Is there any way to achieve this in javascript. I have already seen this



I have already seen this
and this.



but I don't think encoding will solve the problem. Also, this code is entirely in client side. I know that it is not secure but I just need this is a naive, weak defense.
Please help.



Edit



I apologize if my question was not clear earlier.



The URL google.com/?category=textile&user=user1 is being passed on from a different application.



The values passed in the query string directly controls what is being displayed to the user. As is, anyone with no technical knowledge can easily change the value and view the data corresponding to a different category or user. I need to make this unintelligible so that it is not obvious. If a user is a techie and figures out the encryption used, then it is fine. I need a stop-gap solution till we have a better architecture in place


More From » url

 Answers
137

If you don't looking for serious strong crypto, you can use ROT13:



http://en.wikipedia.org/wiki/ROT13



This is enough for slightly obfuscate keys/values in the your URLs.


[#74465] Tuesday, November 5, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aileent

Total Points: 556
Total Questions: 107
Total Answers: 101

Location: Croatia
Member since Fri, Sep 11, 2020
4 Years ago
;