In python, how to hide sensitive data from getting exposed in memory dump?

74 Views Asked by At

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.

  1. by deleting the variable after its use
  2. by pointing the variable to None
  3. by deleting the variable and performing gc.collect()
1

There are 1 best solutions below

0
foolshark On

Python does not offer low level memory control or direct control over memory management.