0

I am trying to decrypt the data using RSA Algorithm. While doing the decryption, I am getting an exception.That is,

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

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

Radu Murzea
  • 10,724
  • 10
  • 47
  • 69
sat
  • 14,589
  • 7
  • 46
  • 65

2 Answers2

1

It's a typo. The correct name for RSA with PKCS #1 v1.5 padding is "RSA/ECB/PKCS1Padding". Generally, it is a good idea to compare with a list of available algorithms. E.g. this question contains some ways to print such a list.

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

Community
  • 1
  • 1
Jack
  • 299
  • 1
  • 3
0

The error means that the library you use cna't decrypt the data because there isn't an algorithm in the Lib which decrypts RSA. You can use a library like Bouncy Calste or GNU Crypto to decrypt data using RSA. There are plenty of samples how to do this on the web.

Timo Hahn
  • 2,466
  • 2
  • 19
  • 16