* 根据数据密钥,构造DesEncrypter对象
*/
// Create encrypter/decrypter class
SecretKeySpec key = new SecretKeySpec(dataKey, "DES");
DesEncrypter decrypter = new DesEncrypter(key);
/*
* DesEncrypter对象调用解密模块,解密出原始文件
*/
File decryptedFile = new File(file.getAbsolutePath() + ".dec");
InputStream in = null;
try {
decrypter.decrypt(new FileInputStream(file), new FileOutputStream(
decryptedFile));
/*
* 返回封装了原始文件的输入流
*/
in = new FileInputStream(decryptedFile);