AES Java加密后exe文件未释放

发布于 2024-10-22 11:12:52 字数 137 浏览 5 评论 0原文

我有一个使用 AES 256 (Java lib)加密文件的函数,然后通过覆盖文件来删除。 由于某种原因,它不适用于 .exe 文件。通过删除加密的文件无法执行“拒绝访问”。我猜测该文件在加密过程中不会被释放,但似乎找不到逻辑解释,因为它适用于所有其他文件。

I have a function that encrypts files using AES 256 ( Java lib ) and then delete by writing over the file.
For some reason it does not work for .exe files. The file gets encrypted by the delete cannot be performed "Access Denied". I am guessing that somehow the file is not released during the encryption but can't seem to find a logical explanation since it works for all the other files.

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

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

发布评论

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

评论(1

ㄟ。诗瑗 2024-10-29 11:12:52

我可以想到两种可能的解释:

  • 文件正在执行,操作系统已锁定它以防止写入干扰正在运行的进程。

  • 文件的访问标志不允许写入;即它是只读的。这不会阻止正常删除工作,因为删除不一定需要对文件进行写访问。 (当然,在 UNIX / Linux 上不行……删除被视为对父目录的操作,并根据目录的访问标志允许/拒绝。)

I can think of two possible explanations:

  • The file is being executed, and the OS has locked it to prevent writes from interfering with the running process.

  • The file's access flags do not allow writing; i.e. it is read-only. This would not prevent a normal delete from working, because deletion does not necessarily require write access to the file. (Certainly it doesn't on UNIX / Linux ... where delete is treated as an operation on the parent directory, and is allowed / denied base on the directory's access flags.)

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