1

Facing the following error after upgrading from BouncyCastleCrypto-1.54 to BouncyCastleCrypto-1.67.

Caused by: java.lang.RuntimeException: Could not generate a cipher with algorithm <ECIESwithAES>
Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting ECIESwithAES

It seems from here the support for this algorithm is no longer present. I could not find any suggestions for the replacement algorithm that can be used. Could someone please help to understand why this algorithm is no longer supported and what is the recommendation for its replacement?

Gopikrishna K S
  • 129
  • 2
  • 7
  • 1
    `ECIESwithAES` has been removed as of version 1.56. `ECIESwithAES` uses the insecure ECB mode (s. [here](https://github.com/bcgit/bc-java/blob/r1rv55/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java#L542)) and was therefore removed for security reasons (s. [Release Notes](https://www.bouncycastle.org/releasenotes.html), 2.14.4, last item). An alternative is `ECIESwithAES-CBC`, which applies the CBC mode (the nonce is generated automatically during encryption or specified explicitly with `IESParameterSpec`). – Topaco Oct 22 '21 at 15:40
  • Thanks a lot for checking this, could you please help with some references comparing the algorithms (is ECIESwithSHA512andAES-CBC better)? Could you please also tell what is the best way to update the part of the system doing the decryption part for backward compatibility? – Gopikrishna K S Oct 25 '21 at 14:21

0 Answers0