hi,
i have problem to convert this function to b4j, i have try several tutorial and lib, but still unsuccess...
best regards
i have problem to convert this function to b4j, i have try several tutorial and lib, but still unsuccess...
Decrypt and decompress:
public function stringDecrypt($timestamp, $data){
$key = $this->cons_id . $this->secretKey . $timestamp;
$encrypt_method = 'AES-256-CBC'; // metode enkripsi
$key_hash = hex2bin(hash('sha256', $key)); // hash
$iv = substr(hex2bin(hash('sha256', $key)), 0, 16); // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
$output = openssl_decrypt(base64_decode($data), $encrypt_method, $key_hash, OPENSSL_RAW_DATA, $iv);
return $output;
}
// decompress response
public function decompress($data){
include_once 'LZCompressor\LZContext.php';
include_once 'LZCompressor\LZData.php';
include_once 'LZCompressor\LZReverseDictionary.php';
include_once 'LZCompressor\LZString.php';
include_once 'LZCompressor\LZUtil.php';
include_once 'LZCompressor\LZUtil16.php';
return LZCompressor\LZString::decompressFromEncodedURIComponent($data);
}
best regards