암호 암호를 사용하여 암호 해독 논리를 수행하고 있습니다. 그 안에서, cipher.getInstance("RSA/NONE/NoPadding")
을 사용하여 암호의 인스턴스를 얻는 동안. 다음 예외가 발생합니다 : NoSuchAlgorithm
.cipher.getInstance 메서드를 사용하는 동안 NoSuchAlgorithm 예외가 발생했습니다.
내 로컬 jboss 서버 설정에서 동일한 코드가 작동하지만 IBM-WAS 서버 설정에서 작동하지 않습니다. 로컬 jboss Server와 WAS Server간에 차이점이 있습니까?
는public static String decrypt(String encrypted, KeyPair keys) {
Cipher dec;
try {
dec = Cipher.getInstance("RSA/NONE/NoPadding"); //Exception raised
dec.init(Cipher.DECRYPT_MODE, keys.getPrivate());
} catch (GeneralSecurityException e) {
throw new RuntimeException("RSA algorithm not supported", e);//Catch block executed
}
}
로그 :
R Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/NoPadding
at java.lang.Throwable.<init>(Throwable.java:80)
at javax.crypto.Cipher.getInstance(Unknown Source)
at com.lsi.utils.JCryptionUtil.decrypt(JCryptionUtil.java:59)
Caused by: java.security.NoSuchAlgorithmException: Mode: NONE not implemented
at com.ibm.crypto.provider.RSA.engineSetMode(Unknown Source)
at javax.crypto.Cipher$a_.a(Unknown Source)
**Jar**
Jce.jar - javax.crypto.Cipher;
bcprov-jdk15-140.jar (External security provider jar)
을 메이크업 결정을 설치 공급자를 확인하지만 잘못 * 그것이 참고하는 것입니다 계수 (키 크기)보다 큰 데이터 블록 또한 "NoPadding"을 사용하는 것은 매우 안전하지 않습니다. 대신 하이브리드 암호 시스템 내에서 OAEP를 사용하십시오. –