-->

PHP Encryption For Generating Fixed Length Encryption Strings

PHP Encryption For Generating Fixed Length Encryption Strings

How about we begin with the genuine PHP work:

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

2.

3. $KeyPhraseLength = strlen($KeyPhrase);

4.

5. /Loop trough input string

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

$salt = 'my_special_phrase';

/ENCRYPT

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

resound "Scrambled: " . $crypted . "

";

The variable ' $salt ' assumes a significant part here. It is basically the 'key' to your scrambled string. The salt esteem will dependably create similar qualities when a similar arithmetic are connected to it. It gives the consistent expected to produce haphazardness. This goes to state that on the off chance that somebody utilizes the salt that was utilized to create the encryption and applies a similar science they can fix or switch the scrambled string once again into the first string content.

Keeping in mind the end goal to decode a scrambled string that was created by utilizing this capacity utilize the invoccation code underneath:

/SALT

$salt = 'my_special_phrase';

/DECRYPT

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

reverberate "Decoded: " . $decrypted;

For whatever length of time that I utilize a similar salt I can turn around a scrambled string that was encoded with this capacity.

Popular Posts

Flag Counter