C
Chick
Hello,
I'm writing a security tool which requies wiping off the memory of
certain string after being used, which I've done by implementing it as
a mutable list as follow:
class secureStr:
def __init__(self, str):
self.__s = []
for i in range(len(str)):
self.s += str
def __str__(self):
return "".join(self.__s)
def wipe(self):
for i in range(len(self.__s)):
self.s = '\x00'
def __del__(self):
self.wipe()
My question is how do I write a function to securely get the password
from user (in text mode)? If I do sth like
import getpass
securePass = secureStr(getpass,getpass())
doesn't that create an immediate string object that will stay in
memory?
I'm writing a security tool which requies wiping off the memory of
certain string after being used, which I've done by implementing it as
a mutable list as follow:
class secureStr:
def __init__(self, str):
self.__s = []
for i in range(len(str)):
self.s += str
def __str__(self):
return "".join(self.__s)
def wipe(self):
for i in range(len(self.__s)):
self.s = '\x00'
def __del__(self):
self.wipe()
My question is how do I write a function to securely get the password
from user (in text mode)? If I do sth like
import getpass
securePass = secureStr(getpass,getpass())
doesn't that create an immediate string object that will stay in
memory?