lib/WalletManager.php
// this is a one way function used for both encrypting and decrypting 8 byte payment IDs
this is a one way function used for both encrypting and decrypting 8 byte payment IDs
this is a one way function used for both encrypting and decrypting 8 byte payment IDs
public function stealth_payment_id($payment_id, $tx_pub_key, $viewkey)
    {
        $der = $this->gen_key_derivation($tx_pub_key, $viewkey);
        $data = $der . '8d';
        $hash = $this->keccak_256($data);
        $key = substr($hash, 0, 16);
        $result = bin2hex(pack('H*',$payment_id) ^ pack('H*',$key));
        return $result;
    }
public function stealth_payment_id ( $ payment_id , $ tx_pub_key , $ viewkey ) { $ der = $ this -> gen_key_derivation ( $ tx_pub_key , $ viewkey ) ; $ data = $ der . '8d' ; $ hash = $ this -> keccak_256 ( $ data ) ; $ key = substr ( $ hash , 0 , 16 ) ; $ result = bin2hex ( pack ( 'H*' , $ payment_id ) ^ pack ( 'H*' , $ key ) ) ; return $ result ; }
this is a one way function used for both encrypting and decrypting 8 byte payment IDs
this is a one way function used for both encrypting and decrypting 8 byte payment IDs