How to obscure a password
Gerrit
gerrit at nl.linux.org
Thu Feb 26 09:15:15 EST 2004
Batista, Facundo wrote:
> So, is there a module to obscure the password text in a secure way?
(...)
> I need to restore the password later and use it as if the user just entered
> it.
If you can restore it, anyone can. So there is theoretically no secure way.
You can scramble it by applying some encodings to it serially:
s = str(int("Hello, world!".encode("rot13").encode("zlib").encode("uu").encode("rot13").encode("hex"), 16))
hex(int(s))[2:-1].decode('hex').encode('rot13').decode("uu").decode("zlib").decode("rot13")
However, it is not secure, especially not now that its on usenet ;-)
Gerrit.
--
Weather in Twenthe, Netherlands 26/02 13:25 UTC:
0.0°C mist overcast wind 5.4 m/s W (57 m above NAP)
--
Asperger's Syndrome - a personal approach:
http://people.nl.linux.org/~gerrit/english/
More information about the Python-list
mailing list