This is not about security. It is also not to make it hard to break. I’m looking for a simple algorithm to change a string (a url) in a way it does not resemble the original. The encryption will be done with javascript. Then I want to feed the encrypted string to a PHP function to change it back to the original. Both ends could share a secret key, or the conversions could be key-less and rely on just logic.
The ideal solution
- will be simple
- will use available javascript functions for encryption
- will use available php functions for decryption
- will produce encrypted string in way not to resemble the plain text at all
- will only use lower-case alphabet characters and numbers in the encrypted string
- is not a method widely used like Base64-ing as encryption.
Edit: The last requirement was added after shamittomar‘s answer.
If that’s what you want, you can Base64 encode and decode that.
[EDIT]: After OP clarification:
As you do not want widely used methods, here is one rarely used method and that can do it for you by giving output only in LOWERCASE letters and NUMBERS. It is Base32 Encode/Decode. Use the following libraries: