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

Clear text password stored for DXL Console #3

Open
shadowbq opened this issue Oct 17, 2017 · 0 comments
Open

Clear text password stored for DXL Console #3

shadowbq opened this issue Oct 17, 2017 · 0 comments

Comments

@shadowbq
Copy link

shadowbq commented Oct 17, 2017

Please implement as secure salted SHA256 hash for the console password storage, and comparison.

The password should never be stored in clear text, or loaded into memory in clear text.

GENERAL_PASSWORD_PROP = "password"

def password(self):
"""
Returns the console password
:return: The console password
"""
return self._password

if username == self.application.bootstrap_app.username and \
password == self.application.bootstrap_app.password:

I would highly recommend not implementing a custom encryption, but rather a BSD licensed one that has been test in the community like 'passlib' https://bitbucket.org/ecollins/passlib/wiki/Home

A quick example of using passlib to integrate into a new application:

>>> # import the context under an app-specific name (so it can easily be replaced later)
>>> from passlib.apps import custom_app_context as pwd_context

>>> # encrypting a password...
>>> hash = pwd_context.hash("somepass")
>>> hash
'$6$rounds=36122$kzMjVFTjgSVuPoS.$zx2RoZ2TYRHoKn71Y60MFmyqNPxbNnTZdwYD8y2atgoRIp923WJSbcbQc6Af3osdW96MRfwb5Hk7FymOM6D7J1'

>>> # verifying a password...
>>> ok = pwd_context.verify("somepass", hash)
True
>>> ok = pwd_context.verify("letmein", hash)
False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants