API WEB 2.0
  • Overview
  • Step-by-step guide
    • Basics
    • Request to create a transaction
    • Transfer initialization request without private key
    • Transfer initialization request with private key
    • Transaction status request
    • Request for obtaining the list of supported networks and tokens
    • Request for obtaining the list of supported token pairs
    • Transaction Data Signature Logic
    • Private key encryption logic
Powered by GitBook
On this page
  1. Step-by-step guide

Private key encryption logic

The client's private key is encrypted using openssl library. AES-256-CBC encryption type, sha256 hash type.

An example of encryption implemented in PHP:

   public function encrypt(string $privateKey, string $encryptedKey): ?string
   {
       $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC'));
       $ciphertextRaw = openssl_encrypt($privateKey, 'AES-256-CBC', $encryptedKey, OPENSSL_RAW_DATA, $iv);
       $hmac = hash_hmac('sha256', $ciphertextRaw, $encryptedKey, true);


       return base64_encode($iv . $hmac . $ciphertextRaw);
   }
PreviousTransaction Data Signature Logic

Last updated 2 years ago