nl_tokens: Decode an encrypted message payload
pl_tokens: function ( recipientPrivate , senderPublic , _payload ) { // Errorsp if ( ! recipientPrivate || ! senderPublic || ! _payload ) throw new Error ( 'Missing argument !' ) ; // Processing let binPayload = convert . hexToUint8 ( _payload ) ; let salt = new Uint8Array ( binPayload . buffer , 0 , 32 ) ; let iv = new Uint8Array ( binPayload . buffer , 32 , 16 ) ; let payload = new Uint8Array ( binPayload . <mask> , 48 ) ; let keyPair = createKeyPairFromPrivateKeyString ( recipientPrivate ) ; let pk = convert . hexToUint8 ( senderPublic ) ; let encKey = deriveSharedKey ( keyPair , pk , salt ) ; let encIv = { iv : ua2words ( iv , 16 ) } ; let encrypted = { 'ciphertext' : ua2words ( payload , payload . length ) } ; let plain = CryptoJS . AES . decrypt ( encrypted , encKey , encIv ) ; // Result let hexplain = CryptoJS . enc . Hex . stringify ( plain ) ; return hexplain ; }