In windows platform, python application data is getting exposed in the memory dump. Memory dump is taken by using process hacker tool.
def f1(self):
# some code
id = "<sensitive_string_data>"
return
If above example is considered, the value of id i.e., <sensitive_string_data> is exposed in the memory dump.
Is there any way to mark such variables as sensitive and hide it from memory dump?
Tried 3 options, but no use.
- by deleting the variable after its use
- by pointing the variable to None
- by deleting the variable and performing gc.collect()
Python does not offer low level memory control or direct control over memory management.