问题描述
如何安全删除java中的文件?我尝试了上的代码,但问题是你由于。
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.
然后我尝试使用,但是第一次使用时我必须单击一个使用协议,我想避免使用它。
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中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!