AES Java加密后exe文件未释放
我有一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以想到两种可能的解释:
文件正在执行,操作系统已锁定它以防止写入干扰正在运行的进程。
文件的访问标志不允许写入;即它是只读的。这不会阻止正常删除工作,因为删除不一定需要对文件进行写访问。 (当然,在 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.)