the pickled file i create using this method is readable in text editor if we forcibly open it,
import pickle,os
print os.path.split(__file__)[0]
storloc= os.path.normpath(os.path.join(os.path.split(__file__)[0],"test.pkl"))
newD={"String":"this is the world", "int":1,"float":1.5}
print newD
print storloc
d = open(storloc, 'wb')
pickle.dump(newD,d)
d.close()
how to make pickled file(test.pkl) unreadable in any text editor?
Attempting to make a simple format such as Python pickles safe for passwords is a fools game.
Use the
keyringpackage instead and leave it to the OS to store your password safely.The
keyringpackage uses the OS-supplied keyring (OS X, Windows, KDE, Gnome), but will fall back to an encrypted store of it’s own if necessary.