Package Initilization Performance Research
2013-01-04 14:15
113 查看
DES/CBC/PKCS5Padding 加密解密
import java.security.Key; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.spec.IvParameterSpec; public class MainClass { public static void main(String args[]) throws Exception { KeyGenerator kg = KeyGenerator.getInstance("DES"); Cipher c = Cipher.getInstance("DES/CBC/PKCS5Padding"); Key key = kg.generateKey(); c.init(Cipher.ENCRYPT_MODE, key); byte input[] = "Stand and unfold yourself".getBytes(); byte encrypted[] = c.doFinal(input); byte iv[] = c.getIV(); IvParameterSpec dps = new IvParameterSpec(iv); c.init(Cipher.DECRYPT_MODE, key, dps); byte output[] = c.doFinal(encrypted); System.out.println(new String(output)); } }
相关文章推荐
- Initilization Package Means Caching
- TypeInitilizationException的解决办法
- Research Career Visulization by 钟亚焘
- MFC Initilization of General Service Control about InitCommonControls和InitCommonControlsEx(MFC 通用控件的初始化InitCommonControls和InitCo
- C++的初始化列表(Initilization List)
- hdu 1050 (preinitilization or postcleansing, std::fill)
- WiFi Wpa_supplicant initilization flow
- Purrr package for R is good for performance
- actioscript3.0 performance 优化
- wince下INI的操作更新
- LAMP 2.8 php.ini配置文件详解
- Node.js 之package.json文件
- boot.ini 调试模式
- 黑马程序员_面向对象3_(异常Exception、包package、String类、StringBuffer类)
- High Performance Mysql 读书笔记——创建高性能索引
- Mysql Native table 'performance_schema'.'session_variables' has the wrong structure
- 查找php.ini路径
- Spring配置项之<context:component-scan base-package="..."/>
- 老李分享: Oracle Performance Tuning Overview 翻译
- lnmp “.user.ini”无法删除解决方法