hey, I don't know if you have seen my other post or not, but I have been working on a small code lately to get the users credentials such as their password and username. As you can see, the code gives a warning and says there is a problem with getpass. After that, It asks for a password. i typed in testpassword which is not my password but it still thought it was. I do not want it to ask me for a password. I want it to simply give me the logged-in users password.

>>> import getpass
>>> f = getpass.getpass()
Warning: Problem with getpass. Passwords may be echoed.
Password: testpassword
>>> print f
testpassword
>>>

I want it to simply give me the logged-in users password.

Generally speaking, programs do not know passwords. A programs takes the password the user entered, converts it using some encryption algorithm, and compares to the stored password (stored in encrypted form only). Otherwise, anyone could steal any password with a simple program.

So basically there is no way to retrieve a users password?

Why?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.