Most of the time we pass unique values as parameters with the url to use the value in the target page. But passing the value directly causes security issue. For example we used to pass some id to view the detail of the selected item. But user can change the id on the address bar mannually and can see the the other item details. To avoid such issue we can pass the encrypted form of the unique value as parameter . And on the target page it’ll be decrypted to actual value.

Here is a small function which can be used to encrypt and decrypt some value: