Blog

安全编码技术:安全删除文件

September 10, 2017
Pieter De Cremer

删除计算机系统上的文件很棘手。每个人,甚至你的母亲,以前都删除了太多文件,他们很高兴发现它仍然在垃圾箱里,能够恢复。

计算机系统中的数据由位序列表示。这意味着系统需要在文件系统中做一些记账才能知道哪些位代表哪个文件。这些信息包括文件的大小、上次修改时间、其所有者、访问权限等。这些簿记数据与文件内容分开存储。

通常,当文件被删除时,代表该文件的位不会发生任何变化,但是簿记数据会发生变化,因此系统知道存储的这一部分现在毫无意义并且可以重复使用。在另一个文件保存在此位置且该位置中的位被覆盖之前,您通常仍然可以恢复保存的数据。这不仅可以提高删除文件的速度,而且通常是撤消删除的有用功能。

但是,这种方法也有缺点。当计算机系统上的应用程序处理敏感信息时,它会将这些数据保存在文件系统的某个地方。在某个时候,当不再需要这些信息时,这些数据可能会被删除。如果不加小心,即使开发人员的意图是删除所有数据,这些数据仍然可以恢复。

完全擦除该数据的最简单方法是使用随机数据重写文件内容(有时甚至多次)。现有有几种安全文件删除方法,它们因存储类型和文件系统(例如Gutmann方法)而异。但是,对于应用程序的日常使用来说,这些有点矫揉造作,你可以自己重写数据。

不过要小心!不要全部使用零或其他低熵数据。许多文件系统可能会优化写入此类稀疏文件并保留一些原始内容。建议在删除文件本身之前,生成安全的随机数据以覆盖整个文件内容。

数据剩余是以某种方式被删除的数据的剩余物理表现形式。擦除存储介质后,可能存在一些允许重建数据的物理特征。

https://fas.org/irp/nsa/rainbow/tg025-2.htm

标语

Govern AI-driven development before it ships

Measure AI-assisted risk, enforce secure coding policy at commit, and accelerate secure delivery across your SDLC.

book a demo
标语

Explore more blogs

Lorem Issum diam quis eim leboutis ein selerisque lobortis sepitis beelrisque lobortis sepitis celerisque lobortis celeriskue filmentis celeriskue filmentis celeriskue diam

browse all
Case Study
Filter Label
This is some text inside of a div block.

Supercharged Security Awareness: How Tournaments are Inspiring Developers at Erste Group

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Learn More
Case Study
Filter Label
This is some text inside of a div block.

Security as culture: How Blue Prism cultivates world-class secure developers

Learn how Blue Prism, the global leader in intelligent automation for the enterprise, used Secure Code Warrior's agile learning platform to create a security-first culture with their developers, achieve their business goals, and ship secure code at speed

Learn More
Case Study
Filter Label
This is some text inside of a div block.

One Culture of Security: How Sage built their security champions program with agile secure code learning

Discover how Sage enhanced security with a flexible, relationship-focused approach, creating 200+ security champions and achieving measurable risk reduction.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Enabler 7: Developer Recognition

Recognition fuels participation. Enabler 7 celebrates developer achievement loudly, with rewards and exclusive swag that mark real, earned secure coding wins.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Named in the Gartner® Hype Cycle™ for Application Security 2026

Secure Code Warrior is named in the Gartner® Hype Cycle™ for Application Security, 2026 for Agentic Coding Security and Secure Coding Training. Here's why.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Are you a CISO or Engineering Leader worried about the Security and Cost of LLM code generation?

Review the SCW AI Trust Index, our proprietary LLM benchmarking data, before going all-in on an AI model.

Learn More

Secure AI-driven development before it ships

See developer risk, enforce policy, and prevent vulnerabilities across your software development lifecycle.

预约演示
No items found.