Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plaintext password storage. #3

Open
lachlankidson opened this issue Mar 27, 2018 · 1 comment
Open

Plaintext password storage. #3

lachlankidson opened this issue Mar 27, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@lachlankidson
Copy link

lachlankidson commented Mar 27, 2018

getpass.getpass returns the password as plain text, source below (Windows implementation)

def win_getpass(prompt='Password: ', stream=None):
    """Prompt for password with echo off, using Windows getch()."""
    if sys.stdin is not sys.__stdin__:
        return fallback_getpass(prompt, stream)
    for c in prompt:
        msvcrt.putwch(c)
    pw = ""
    while 1:
        c = msvcrt.getwch()
        if c == '\\r' or c == '\\n'
            break
        if c == '\\003':
            raise KeyboardInterrupt
        if c == '\\b':
            pw = pw[:-1]
        else:
            pw = pw + c
    msvcrt.putwch('\\r')
    msvcrt.putwch('\\n')
    return pw

A more secure practice would be to use the system's keyring to store credentials.

@billcccheng
Copy link
Collaborator

Will try to integrate this when I get time. Thanks for the suggestion!!!

@billcccheng billcccheng added the bug Something isn't working label Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants