【问题标题】:Can a program leave no traces behind when handling passwords?程序在处理密码时可以不留下任何痕迹吗?
【发布时间】:2016-10-05 00:49:00
【问题描述】:

有一个脚本可以生成密码并将其存储在变量和文件中。然后变量中的密码用于加密另一个文件。而已!现在写起来不难,难的是:你能删除all痕迹吗?因为从我读到的脚本(和输出)中的命令保存在某处。

回到问题:

  • 脚本如何删除曾经执行过的脚本、包含密码和输出的变量的所有痕迹? (更喜欢我可以放入 'script.sh' 的命令)
  • 输出和变量值保存在哪里?

注意:我是这个社区的新手,所以请随时就问题的质量提供反馈。

【问题讨论】:

  • 有 ~/.bash_history 是您在终端中亲自调用的命令的日志,但它不会保存在代码中所做的事情。如果安全性是一个高度关注的问题,请考虑使用一种可以让您处理堆栈和堆的语言(C、C++、...)。 benpfaff.org/papers/shredding.pdf
  • 感谢推荐,pdf文件很详细。

标签: linux bash logging encryption passwords


【解决方案1】:

~./bash_history - 在正常情况下 - 只有你和 root 才能访问。你可能有一个 cronjob 来偶尔或经常清空这个文件。这可能很简单:

#m h  dom mon dow   command
 * *   *   *   *    cat /dev/null>~./bash_history

如果以上方法不能解决您的问题,您可以使用名为bleachbit 的工具。

$ apt-cache show bleachbit

给了我:

Description-en: delete unnecessary files from the system
 BleachBit deletes unnecessary files to free valuable disk space, maintain
 privacy, and remove junk. It removes cache, Internet history, temporary files,
 cookies, and broken shortcuts.
 .
 It handles cleaning of Adobe Reader, Bash, Beagle, Epiphany, Firefox, Flash,
 GIMP, Google Earth, Java, KDE, OpenOffice.org, Opera, RealPlayer, rpmbuild,
 Second Life Viewer, VIM, XChat, and more.
 .
 Beyond simply erasing junk files, BleachBit wipes free disk space (to hide
 previously deleted files for privacy and to improve compression of images),
 vacuums Firefox databases (to improve performance without deleting data), and
 securely **shreds** arbitrary files.

注意它处理 bash 的清理。

请查看 BleachBit [ features ] 页面。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-20
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 2011-09-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多