0

I am trying to encrypt a card number using RSA OAEP SHA-256 format using node js. Then I am supposed to send this encrypted card number with to the exp. date and key id to Cybersource. I am given the public key in a jwk format. This includes the key_id, algorithm, etc. I have tried multiple ways, including converting the jwk key to a pem format. Have not succeeded yet.

This is the error I get when I attempt to enter an encrypted card number I created:

(node:2673) UnhandledPromiseRejectionWarning: StatusCodeError: 400 - "{\"responseStatus\":{\"status\":400,\"reason\":\"DECRYPTION_ERROR\",\"message\":\"Cannot decrypt PAN (RsaOaep256): data hash wrong\",\"correlationId\":null,\"details\":[],\"_embedded\":{}},\"_links\":{\"self\":null,\"documentation\":[],\"next\":[]}}

Any ideas?

sstoll13
  • 1
  • 1

0 Answers0