Java默认加密/ AES行为 [英] Java default Crypto/AES behavior
问题描述
有没有人知道默认的Java crypto行为是:
Does anyone know what the default Java crypto behavior is for:
SecretKeySpec localSecretKeySpec = new SecretKeySpec(arrayOfByte, "AES");
Cipher localCipher = Cipher.getInstance("AES");
具体来说,我想了解这些类如何生成IV,以及什么是默认加密模式时,只需指定AES。感谢。
Specifically I am looking to understand how those classes generate the IV, as well as what is the default encryption mode when just specifying "AES". Thanks.
推荐答案
对于Oracle JDK 7(测试),AES的默认密码为AES / ECB / PKCS5Padding。 Java安全文档没有提到这一点(http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#algspec),必须做一些JUnit测试才能找出来。
For Oracle JDK 7 (tested), the default cipher for AES is AES/ECB/PKCS5Padding. The Java Security documentation doesn't mention about this though (http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#algspec), have to do some JUnit testing to find out.
这篇关于Java默认加密/ AES行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!