How To Encrypt and Decrypt String Using PHP With Salt

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest0Digg thisShare on StumbleUpon0

encrypt decrypt php string

In PHP there are lots of method to encrypt and decrypt the string. In this article we are going to explain the basic encryption and decryption of a string using AES-256 algorithm with SALT (Private key). We are using public and private key concept for encryption and decryption of string.

A private key is a random generated string which we kept on the server side.
A public key is a random generated string that is sent to the browsers client.

Generate the private key Click Here

Security.php – Class file having all the method to encrypt and decrypt the string using PHP.


Reference – Wappy


  1. By jose


  2. Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">