如果您想删除文件的所有痕迹,移动文件是否比删除它更安全?

发布于 2024-12-31 21:50:23 字数 1459 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

嘴硬脾气大 2025-01-07 21:50:23

您应该考虑使用Linux命令shr​​ed,它会在完全删除目标文件之前多次覆盖目标文件,这使得文件“不可能”恢复。

您可以在此处阅读有关粉碎命令的一些信息。

仅移动文件并不能永远保护您,如果您将其移动到外部存储,则文件的本地版本将被删除,就像使用 rm 命令一样。

You should consider using the Linux command shred, which overwrites the target file multiple times before deleting it completely, which makes it 'impossible' to recover the file.

You can read a bit about the shred command here.

Just moving the file does not cover you for good, if you moved it to external storage, the local version of the file is deleted just as it is with the rm command.

于我来说 2025-01-07 21:50:23

不,那也没有帮助。

在文件系统之间移动时实际上仍然只是内部的“复制+rm”。文件在“源”媒体上的原始存储位置仍然存在,只是标记为可用。在文件系统内移动根本不会触及文件字节,它只是更新簿记以表示“文件 X 现在位于位置 Y”。

要真正擦除文件,您必须覆盖其所有字节。再一次,技术阻碍了这一点 - 如果您使用固态存储介质,则向文件写入“垃圾”的可能性非常高,不会触及文件存储的实际晶体管,但是实际上是在完全不同的地方写的。

对于磁性介质,用交替的 0x00、0xFF 和随机字节重复覆盖最终将彻底破坏文件。对于 SSD/闪存系统,它要么必须提供“安全擦除”选项,要么必须将芯片粉碎成灰尘。对于光学介质来说,情况更加复杂。 -r 介质不能被擦除,只能被破坏。对于-rw,我不知道需要多少次重复写入周期才能真正擦除这些位。

No. that won't help either.

A move when going between file systems is really still just a "copy + rm" internally. The original storage location of the file on the "source" media is still there, just marked as available. A moving WITHIN a file system doesn't touch the file bytes at all, it just updates the bookkeeping to say "file X is now in location Y".

To truly wipe a file, you must overwriteall of its bytes. And yet again, technology gets in the way of that - if you're using a solid state storage medium, there is a VERY high chance that writing 'garbage' to the file won't touch the actual transistors the file's stored in, but actually get written somewhere completely different.

For magnetic media, repeated overwriting with alternating 0x00, 0xFF, and random bytes will eventually totally nuke the file. For SSD/flash systems, it either has to offer a "secure erase" option, or you have to smash the chips into dust. For optical media, it's even more complicated. -r media cannot be erased, only destroyed. for -rw, I don't know how many repeated-write cycles are required to truly erase the bits.

爱*していゐ 2025-01-07 21:50:23

不(不仅仅是因为将其移动到计算机上的其他位置并不会将其从计算机中删除)。完全删除文件的方法是完全覆盖其所在磁盘上的空间。 Linux 命令 shr​​ed 将完成此任务。

No (and not just because moving it somewhere else on your computer is not removing it from the computer). The way to completely remove a file is to completely overwrite the space on the disk where it resided. The linux command shred will accomplish this.

痴者 2025-01-07 21:50:23

基本上,不,在大多数文件系统中,您无法保证文件在不进入非常低级别的情况下被覆盖。删除文件和/或移动它只会更改指向该文件的指针,而不会以任何方式更改文件系统中存在的文件。即使是 Linux 命令 shred 也不能保证在许多文件系统中删除文件,因为它假设文件被就地覆盖。

在 SSD 上,您的数据更有可能保留很长时间,因为即使文件系统尝试覆盖块,SSD 也会重新映射以写入新块(如果写入了数据,则擦除需要很长时间)最后

,使用现代文件系统和磁盘,安全存储文件的最佳机会就是从一开始就对它们进行加密。如果它们以明文形式存储在任何地方,则它们可能非常难以删除,并且从磁盘恢复加密文件(或与此相关的备份)对于任何人来说都没有多大用处。加密密钥。

Basically, no, in most file systems you can't guarantee that a file is overwritten without going very low level. Removing a file and/or moving it will only change the pointer to the file, not the files existence in the file system in any way. Even the linux command shred won't guarantee a file's removal in many file systems since it assumes files are overwritten in place.

On SSDs, it's even more likely that your data stays there for a long time, since even if the file system would attempt to overwrite blocks, the SSD will remap to write to a new block (erasing takes a lot of time, if it wrote in place things would be very slow)

In the end, with modern file systems and disks, the best chance you have to have files stored securely is to keep them encrypted to begin with. If they're stored anywhere in clear text, they can be very hard to remove, and recovering an encrypted file from disk (or a backup for that matter) won't be much use to anyone without the encryption key.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文