<pre>
//Encryption
function encryption_function($string){
// Storingthe cipher method
$ciphering = "AES-128-CTR";
// Using OpenSSl Encryption method
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
// Non-NULL Initialization Vector for encryption
$encryption_iv = '0000111122223333';
// Storing the encryption key
$encryption_key = "aviweb";
return openssl_encrypt($string, $ciphering, $encryption_key, $options, $encryption_iv);
}
//Decryption
function decryption_function($string){
// Storingthe cipher method
$ciphering = "AES-128-CTR";
// Using OpenSSl Encryption method
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
// Non-NULL Initialization Vector for encryption
$decryption_iv = '0000111122223333';
// Storing the decryption key
$decryption_key = "aviweb";
return openssl_decrypt($string, $ciphering, $decryption_key, $options, $decryption_iv);
}
</pre>
Like this:
Like Loading...
Related