废话不多说,直接上代码

直接运行 main,解密后的文件均在 replace 路径下(如本代码中:D:/pierced/windows_641-新副本)

package com.example.demologin;import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.text.DecimalFormat;/*** @Classname: Decrypt* @Version:V1.0*/
public class Decrypt {//待解密的文件夹路径private static String rootFolderPath = getFullpath("D:","\\pierced\\windows_641");//待解密文件夹路径中的文件夹private static String beReplaced = "windows_641";private static String replace = beReplaced + "-新副本";//被替换的文件夹//解密文件数private static Integer fileCount = 0;//解密文件大小private static Long fileSize = new Long(0);public static void main(String[] args) {try {Long startTime = System.currentTimeMillis();decryptFolder(new File(rootFolderPath));System.out.println("------------------------------------------------------------------------------------------------");System.out.print("解密完成,共计耗时:"+new DecimalFormat("0.00").format((double)(System.currentTimeMillis()-startTime)/1000)+"s");System.out.print("\t共计文件:"+fileCount+"个");System.out.print("\t共计文件大小:"+new DecimalFormat(",##0.00").format((double)fileSize/1024/1024/1024)+"GB");System.out.print(" = "+new DecimalFormat(",##0.00").format((double)fileSize/1024/1024)+"mb");System.out.println(" = "+new DecimalFormat(",##0.00").format((double)fileSize/1024)+"kb");} catch (Exception e) {e.printStackTrace();}}/*** @Methodname: getFullpath* @Discription: TODO 拼接完整的路径  根据操作系统拼接连接符* @param dir 路径* @return*/private static String getFullpath(String... dir){StringBuffer fullPath = new StringBuffer("");for (int i = 0; i < dir.length; i++) {fullPath.append(dir[i]);if (dir.length-1!=i) {fullPath.append(File.separator);}}return fullPath.toString();}/*** @Methodname: decryptFolder* @Discription: TODO 解密整个文件夹* @param folder 文件夹* @throws Exception*/private static void decryptFolder(File folder)throws Exception {if (!folder.isDirectory()) {return;}File[] files = folder.listFiles();for (File file : files) {if (file.isFile()) {//进行解密操作decryptFile(file);fileCount ++;fileSize += file.length();continue ;}//创建文件夹File childFolder =new File(getFullpath(folder.getPath(),file.getName()));File newChilFolder =new File(childFolder.getPath().replaceFirst(beReplaced,replace));if (newChilFolder.exists()) {newChilFolder.delete();}newChilFolder.mkdir();//进行递归decryptFolder(childFolder);}}private static void decryptFile(File file){try {File newFile = new File(file.getPath().replaceFirst(beReplaced,replace));if (newFile.exists()) {newFile.delete();}File newFile1 = new File(newFile.getParent());newFile1.mkdir();newFile.createNewFile();FileOutputStream output = new FileOutputStream(newFile);InputStream input = new FileInputStream(file);int length = -1;byte[] _byte = new byte[8000];System.out.println(file.getPath());int sum = input.available();System.out.print("文件名:"+file.getPath());System.out.print("\t文件大小:"+new DecimalFormat("0.00").format((double)file.length()/1024)+"kb");System.out.print("\t已解密大小:"+new DecimalFormat("0.00").format((double)(file.length()-input.available())/1024)+"kb");System.out.println("\t已解密比例:"+(sum==0?"100%":new DecimalFormat("0.00%").format((double)(sum-input.available())/sum))+"kb");while ((length=input.read(_byte))!=-1) {System.out.print("文件名:"+file.getPath());System.out.print("\t文件大小:"+new DecimalFormat("0.00").format((double)file.length()/1024)+"kb");System.out.print("\t已解密大小:"+new DecimalFormat("0.00").format((double)(file.length()-input.available())/1024)+"kb");System.out.println("\t已解密比例:"+(sum==0?"100%":new DecimalFormat("0.00%").format((double)(sum-input.available())/sum)));output.write(_byte, 0, length);}System.out.println();input.close();output.close();} catch (Exception e) {e.printStackTrace();}}
}

Java绿盾解密- Ldterm(绿盾加密文件解密)相关推荐

  1. PDF加密文件解密方法(解除复制打印限制)——转帖

    PDF加密文件解密方法(解除复制打印限制) 小 前言:因为现在网络上下载的PDF文件很多都带有安全性设置,通常的安全设置有:文档打印不允许.更改文档不允许.内容复制或提取不允许等等.在实际运用中,我们 ...

  2. java根据密码字典解密word和excel加密文件

     本类为word解密的工具类,后期还会有压缩包的加密解密,以及暴力破解相关方法,喜欢的朋友可以关注我的后期更新,尊重原创,切勿胡乱转发 /** * @Description word破解工具类* * ...

  3. php为什么容易解密,PHP代码的加密和解密

    现在常见的对PHP代码进行加密的方式主要分为两大类: Ø 不需要加载php扩展的: Ø 需要加载php扩展的 第一种方式使用方便,不需要对php服务器进行配置,或加载其他模块,因此可以方便地部署在租用 ...

  4. php signature解密,openssl RSA非对称加密、解密、签名、验签

    需要先了解的openssl系列函数 openssl_pkey_get_private 从证书中解析获取私钥,以供使用.成功,返回真实的密钥资源标识符(Resource ID),否则返回false op ...

  5. python 加密解密_Python中的加密和解密

    1.base64 Python内置的base64模块可以实现base64.base32.base16.base85.urlsafe_base64的编码解码,python 3.x通常输入输出都是二进制形 ...

  6. php 破解加密帖子,某PHP加密文件解密过程初探 · 浮萍’s Blog

    最近在52PJ上看到一篇关于PHP加密解密的帖子,过程非常详细,而且作者很负责,对于别人的回答也很热心.跟着动手做了一下,记录一下遇到的问题.这里针对的是PHP加密网站的免费加密进行的调试. 采用的I ...

  7. oracle实现aes解密_Oracle的AES加密与解密用法

    Oracle的AES加密与解密用法 2013年12月11日 11:50:35 iteye_751 阅读数:428 --加密字符串 create or replace function des3_enc ...

  8. autojs加解密,文本/字符串的加密和解密脚本源码分享

    说明 本文提供的代码仅供参考.不建议用于生产环境. 可能有些地方在最新版本的Auto.js上面需要做修改,才能运行. Auto.js简介 Auto.js是利用安卓系统的"辅助功能" ...

  9. python实现md5加密和解密_Python中的加密和解密

    1.base64 Python内置的base64模块可以实现base64.base32.base16.base85.urlsafe_base64的编码解码,python 3.x通常输入输出都是二进制形 ...

  10. php cookie 加密解密,php 使用base64加密、解密cookie的示例

    这篇文章主要为大家详细介绍了php 使用base64加密.解密cookie的示例,具有一定的参考价值,可以用来参考一下. 感兴趣的小伙伴,下面一起跟随512笔记的小编罗X来看看吧. 经测试代码如下: ...

最新文章

  1. 推荐一个女画家的系列画:《公主的妄想症》之《喜欢就是要全部》
  2. 一文看懂async和“await”关键词是如何简化了C#中多线程的开发过程
  3. Java学习----方法的重载
  4. 虫师自动化测试robot Framework 框架的学习2
  5. python面向对象和面向过程_python--什么是面向对象和面向过程,对象的进化,什么是对象...
  6. SaaS 公司如何应对 On-Call 挑战?
  7. 创业有很多种方式,方法,而且是形式多样
  8. yii2的分页和ajax分页
  9. window server2012服务器上如何安装nginx并启动
  10. 7纳米,80核:Ampere第二代云数据中心Arm芯片即将推出
  11. [听风]TBC单体插件数据统计Recount
  12. php蘑菇街商城源码,php源码:dedecms精仿蘑菇街(mogujie.com)源码,时尚购物社区源码...
  13. redis-manger管理平台
  14. CTF·WEB入门之路
  15. meta标签(以京东首页为例)
  16. KeyShot 实时光线追踪三维渲染软件
  17. 构建CA证书详解过程步骤
  18. 常用技巧精选(一)尺取法
  19. MyCAT数据库分片(一)
  20. 产业区块链一周新动态

热门文章

  1. C语言自动处理异常,C语言中异常错误处理机制浅析
  2. 蓝屏,BAD_SYSTEM_CONFIG_INFO,0x00000074故障
  3. 《数字图像处理 第三版》(冈萨雷斯)——第九章 形态学图像处理
  4. vlfeat工具包的MATLAB安装
  5. python中怎么调整代码字体格式_PyCharm中代码字体大小调整方法
  6. php使用redis实例,php中使用redis队列操作实例代码
  7. 强大的代码保护软件 .NET Reactor使用教程(四): .NET Reactor针对De4Dot脱壳工具的应对
  8. java adt eclipse_在eclipse中添加android ADT
  9. allegro使用经验
  10. 电路故障检测与调试分析