简体   繁体   English

如何在 Java 中使用 RSA_PKCS1_OAEP_PADDING 加密

[英]How to use RSA_PKCS1_OAEP_PADDING encrypt in Java

In Java,how to use RSA_PKCS1_OAEP_PADDING to encrypt?在 Java 中,如何使用 RSA_PKCS1_OAEP_PADDING 进行加密? when i use this below ,it shows "javax.crypto.NoSuchPaddingException:RSA/ECB/OAEPPadding unavailable with RSA".当我在下面使用它时,它显示“javax.crypto.NoSuchPaddingException:RSA/ECB/OAEPPadding 对 RSA 不可用”。

cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", provider); cipher = Cipher.getInstance("RSA/ECB/OAEPPadding", 提供者);

Can you tell me the correct answer?thanks!你能告诉我正确的答案吗?谢谢!

Try without specifying a provider, that is:尝试不指定提供者,即:

cipher = Cipher.getInstance("RSA/ECB/OAEPPadding");

If you want to use a specific provider, provide more information about which provider you are using, and what evidence you have that the provider supports OAEP padding.如果您想使用特定的提供程序,请提供有关您正在使用的提供程序的更多信息,以及您有什么证据表明该提供程序支持 OAEP 填充。

There is meta-data in the provider itself about the services it provides and their details.提供者本身有关于它提供的服务及其详细信息的元数据。 We can look into that further if needed, but I think the answer here is simply that this provider doesn't make any provision for OAEP.如果需要,我们可以进一步研究,但我认为这里的答案很简单,即该提供商没有为 OAEP 做出任何规定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 相当于Java的RSA_PKCS1_OAEP_PADDING - RSA_PKCS1_OAEP_PADDING equivalent for Java Java 使用 NodeJS 加密解密<rsa_pkcs1_oaep_padding>填充和<sha256> oepHash</sha256></rsa_pkcs1_oaep_padding> - Java Decrypt with NodeJS Encrypt <RSA_PKCS1_OAEP_PADDING> padding and <sha256> oaepHash bouncycastle支持RSA PKCS1-OAEP填充吗? - Is RSA PKCS1-OAEP padding supported in bouncycastle? RSA OAEP,Golang Decrypt,Java Encrypt - RSA OAEP , Golang Decrypt , Java Encrypt 使用弹性城堡和python PKCS1-OAEP的Java RSA加密 - java RSA encryption using bouncy castle and python PKCS1-OAEP Pycrypto RSA PKCS1 OAEP SHA256 与 Java 的互操作性 - Pycrypto RSA PKCS1 OAEP SHA256 Interoperability with Java 如何在 android 中使用 (RSA/ECB/PKCS1Padding) - how to use (RSA/ECB/PKCS1Padding) in android RSA OAEP,Golang加密,Java Decrypt -BadPaddingException:解密错误 - RSA OAEP, Golang Encrypt, Java Decrypt -BadPaddingException: Decryption error RSA使用Pycrypto OAEP进行加密,并使用普通的旧Java进行解密 - RSA encrypt with Pycrypto OAEP and decrypt with plain old Java 如何使用算法 RSA/ECB/PKCS1Padding 通过加密字符串的 node.js 进行加密 - How to encrypt through node.js of encrypted string using algorithm RSA/ECB/PKCS1Padding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM