Java默认加密/ AES行为 [英] Java default Crypto/AES behavior

查看:486
本文介绍了Java默认加密/ AES行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道默认的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆