Let’s begin with the precise PHP perform:

1. perform XOREncryption($InputString, $KeyPhrase){


3.     $KeyPhraseLength = strlen($KeyPhrase);


5.     // Loop trough enter string

6.     for ($i = 0; $i //SALT

$salt = ‘my_special_phrase’;


$crypted = base64_encode(XOREncryption(‘my string’, $salt));

echo “Encrypted: ” . $crypted . “

 The variable ‘ $salt ‘ performs an important position right here.  It’s basically the ‘key’ to your encrypted string. The salt worth will all the time generate the identical values when the identical arithmetic are utilized to it.  It supplies the fixed wanted to generate randomness.  This goes to say that if somebody makes use of the salt that was used to generate the encryption and applies the identical arithmetic they will undo or reverse the encrypted string again into the unique string textual content.

To be able to decrypt an encrypted string that was generated by utilizing this perform use the invoccation code under:


$salt = ‘my_special_phrase’;


$decrypted  = XOREncryption(base64_decode($crypted), $salt);

echo “Decrypted: ” . $decrypted;

So long as I exploit the identical salt I can reverse an encrypted string that was encrypted with this perform.

Does this article make any sense? We didn't think so either because it is written by a robot.

Hilium is built by ecommerce pros! We harnessed the power of WordPress + WooCommerce + Divi Builder + $1000’s of the best Premium Plugins (not free versions) and put them all on a Google Cloud Platform with Litespeed. Now you can have it all at a fraction of the cost. We give you an Enterprise Cloud Solution like the big boys have but for a price of a cup of coffee.

Try us today free for 14 days. No credit card required.