使用PHP 5.3.x安全删除 [英] Secure delete with PHP 5.3.x

查看:85
本文介绍了使用PHP 5.3.x安全删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一个很好的PHP解决方案来从Linux系统删除或更好地擦除文件吗?

Does someone knows an good PHP Solution to delete or better wipe an file from an linux system?

场景: 文件被加密并保存,当请求下载时,文件被复制到一个临时文件夹中并被解密.这已经在工作.

Scenario: File is encrypted and saved, when a download is requested the file is copyed to an temporary folder and decrypted. This is already working.

但是在发送给用户后如何从临时位置删除文件?

But how to remove the file from the temporary location after sending in to the user?

在我看来,我有以下选择:

In my mind i have the following options:

  • 通过"fopen"打开文件,然后向其中写入0,1(以为很慢)
  • 将文件保存到Memcache中,而不是保存到硬盘中(我的主机可能有问题)
  • 在命令行上或作为cronjob使用somd 3rd pary工具(安装可能会出现问题)

目标:从硬盘中删除文件,无法恢复(擦除/覆盖)

Goal: Delete the file from hard disk, without the possibility to recover (wipe/overwrite)

推荐答案

调用"切碎"通过exec/system/passthru

Call "shred" via exec/system/passthru

这篇关于使用PHP 5.3.x安全删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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