How to solve NoSuchAlgorithmException in java?

I am trying to decrypt data using RSA Algorithm. When decrypting, I get an exception. I.e,

java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/ECB/PKCS5Padding at javax.crypto.Cipher.getInstance(DashoA13*..) 

How to solve this exception? I am currently using java version "1.6.0_26" .

0
source share
2 answers

It's a typo. The correct RSA name with PKCS # 1 v1.5 is "RSA / ECB / PKCS1Padding". As a rule, it is a good idea to compare with the list of available algorithms. For instance. this question contains some ways to print such a list.

(And, of course, using OAEP instead of v1.5 firmware would be preferable, especially if your main field is not cryptography).

+1
source

The error means that the library you are using does not decrypt data, because there is no algorithm in Lib that decrypts RSA. You can use a library like Bouncy Calste or GNU Crypto to decrypt data using RSA. There are many examples of how to do this on the Internet.

0
source

Source: https://habr.com/ru/post/927731/


All Articles