Visa Developer Community

RsaOaep256 Encryption - CyberSource Flex API

Hi Trying to use the Cybersource Flex API . NODE-JS applicaiton

 

Generated the x-pay-token and got the key back.  Encrypted the card number with the returned public key . But getting this error.

 

"responseStatus": {
        "status": 400,
        "reason": "DECRYPTION_ERROR",
        "message": "Cannot decrypt PAN (RsaOaep256): data hash wrong",
        "correlationId": null,
        "details": []
    },

Can you please point me if there are any sample s for NODE.js that we should follow to peform the encryption of CARD number for TOKENIZE CARD Request ?

 

And Also what are the supported encrytion types ? I dont see any documentation regarding this.  Thankyou.

 

-SS

 

 

 

4 REPLIES
Community Manager

Re: RsaOaep256 Encryption - CyberSource Flex API

Hi SS,

 

Working on getting you an answer. Will get back shortly.

 

Thanks,

Ricardo

Community Manager

Re: RsaOaep256 Encryption - CyberSource Flex API

Hi SS,

 

  1. Flex is designed for the PAN to be encrypted on the client side: bringing the PAN server-side to encrypt will expand PCI DSS scope. Ensure that the PAN is encrypted on the client (e.g. the browser or native app).
  2. The card number field should be encrypted using RSA OAEP SHA-256 – currently this is the only encryption method supported.
  3. We have some Flex sample code available in Java on GitHub, which is a browser based implementation that makes use of the WebCrypto API. NODE.js sample code is coming soon. SDKs are also currently being planned.

 

Does this help?

 

Thank you,

Ricardo

Re: RsaOaep256 Encryption - CyberSource Flex API

Thanks Ricardio,

 

Points 1 , 2 are helpful and answers the question.

Do you have ETA of when can we expected the NodeJS Samples.? Is there a git link to watch for ? 

 

thanks

Srinivas

Helper

Re: RsaOaep256 Encryption - CyberSource Flex API

Hi everyone,

I have the same issus, when I try tokenizing the card info:
</pre>
Response
<pre>

"responseStatus": {
"status": 400,
"reason": "DECRYPTION_ERROR",
"message": "Cannot decrypt PAN (RsaOaep256): data hash wrong",
"correlationId": null,
"details": []
}

</pre>

Please, have you found any solution to this problem?