Encrypt by jsbn library and then decrypt by WebCrypto

267 Views Asked by At

We're using jsbn library PKCS#1 encryption-style padding for encrypt the message. And now we want to change jsbn library for web crypto.

There is no problem With AES key. Problem is with RSA key.

I have encrypted message by jsbn library. Is possible to decrypt the message by web crypto with RSA key?

WebCrypto documentation supports only RSA-OAEP algorithm for decryption, is there possible to use PKCS (RSASSA-PKCS1-v1_5) algorithm?

1

There are 1 best solutions below

0
On

The RSASSA-PKCS1-v1_5 algorithm is a signing algorithm. Probably you meant RSAES-PKCS1-v1_5 algorithm, but it was deprecated in an early stage of the development of Web Crypto API. In order to use it this algorithm in JavaScript you will need to use side solutions (webcrypto "shims" let's say). Just for your information here is link to WebCrypto API implementation status for Chromium project.