如何安全地删除java中的文件 [英] How to securely delete files in java

查看:155
本文介绍了如何安全地删除java中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何安全删除java中的文件?我尝试了 javafaq.nu 上的代码,但问题是你由于此错误,因此无法在Windows映射后删除该文件

How do I securely delete files in java? I tried the code at javafaq.nu, but the problem is you can't actually delete the file on windows once it has been mapped due to this bug.

然后我尝试使用 sysinternals sdelete ,但是第一次使用时我必须单击一个使用协议,我想避免使用它。

Then I tried just using sysinternals sdelete on windows, but you have to click a usage agreement the first time you use it which I want to avoid.

推荐答案

在像NTFS这样的日志文件系统上,实际上没有办法在不擦除驱动器上的所有可用空间的情况下安全地擦除单个文件。问题是新的块(你可能用随机数据覆盖)不能保证与旧的块在磁盘上的相同位置。

On a journaling filesystem like NTFS there is actually no way to securely erase a single file without wiping all the free space on the drive. The problem is that the new blocks (which you've presumably overwritten with random data) are not guaranteed to be in the same place on disk as the old ones.

实用程序就像sdelete可能适合你一样,但是可以简单地将那个可执行文件替换为不会阻止这种防御方法的那个。

Utilities like sdelete might work for you, but one could simply replace that executable with one that does nothing to thwart that method of defence.

为了保证你的数据安全,只有真正的解决方案是完全加密驱动器。

In order to keep your data secure, the only real solution you have is to completely encrypt the drive.

这篇关于如何安全地删除java中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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