CasperSecurity
<?php
function amebiCrypt( $string, $action) {
$secret_key = 'xyOBFABRk8NaEROoWoqnAw==';
$secret_iv = '14t/gQBFlgczT7aR+nVEqg==';
$output = false;
$encrypt_method = "AES-256-CBC";
$key = hash( 'sha256', $secret_key );
$iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );
if( $action == 'e' ) {
$output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
}
else if( $action == 'd' ){
$output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );
}
return $output;
}
function amebiCrypt2( $string, $action) {
$secret_key = '21B3F213E19AB41016252DD7D55DE4CAB1E349F4DEC05DB5D7C1E595BBA2A18E';
$secret_iv = 'EEB7F58385CEB0A09556A80440A03B91327B75CC';
$output = false;
$encrypt_method = "AES-256-CBC";
$key = hash( 'sha256', $secret_key );
$iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );
if( $action == 'e' ) {
$output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
}
else if( $action == 'd' ){
$output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );
}
return $output;
}
?>