python - 处理凭据时从内存和后备存储中删除数据?
问题描述
我正在开发一个需要使用 Python 的项目,我需要处理通过 python 应用程序传递的密码,没有一个是硬编码的。
经过一番挖掘,我发现python没有直接从内存中删除对象的方法,最好的解决方案是del <object name>
通过调用垃圾收集器来使用以下内容:
import gc
# remove the reference to the object in memory
del <object>
# call the garbage collector to remove all unreferenced objects
gc.collect()
这似乎可行,但是后备存储中的内存呢,如果进程运行了很长时间,这种方法会确保后备存储中仍然没有对象吗?
这甚至可能不是 python 的问题,但我想确保我的实现是足够的。
解决方案
推荐阅读
- amazon-web-services - 访问在私有 k8 集群上运行的 Kubernetes 仪表板
- machine-learning - 对倾斜数据进行 ML 模型验证
- javascript - 将接收到的 JSON 打印到表中
- c# - 使用 Fluent API 编写一对一关系
- spring-boot - SpringBoot 2.x Spring 5.x Oauth 2.0 Spring security Bitbucket 集成
- abap - 具有对话框和报告类型程序的程序的事务类型
- jenkins - Jenkins: None of the test reports contained any result
- php - Laravel 5.7 - 访问通知内视图模板
- kotlin - io.micronaut.runtime.Micronaut - 找不到嵌入式容器
- asp.net-web-api - Slack Web API 不更新用户配置文件