A simple two-way function to encrypt or decrypt a string

72 Shares

Update: I have released Ncrypt, a library (OOP based) that facilitates the same (two-way encryption and decryption). See here

This function will provide you a two-way system to encrypt a string or decrypt an encrypted string.

So, how to encrypt a string?

Just call this function and pass your string. Additionally set your second parameter to 'e' (optional). To encrypt Hello World!, write-

It’ll generate a encrypted string RTlOMytOZStXdjdHbDZtamNDWFpGdz09

And, how to decrypt?
Pass your encrypted string to the function and set second parameter to 'd'.

 

Need help with your WordPress tasks?

72 Shares