Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release (1.2.1).
Password generation for the IPython notebook.
Generate hashed password and salt for use in notebook configuration.
In the notebook configuration, set c.NotebookApp.password to the generated string.
Parameters: | passphrase : str
algorithm : str
|
---|---|
Returns: | hashed_passphrase : str
|
Examples
>>> passwd('mypassword')
'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12'
Verify that a given passphrase matches its hashed version.
Parameters: | hashed_passphrase : str
passphrase : str
|
---|---|
Returns: | valid : bool
|
Examples
>>> from IPython.lib.security import passwd_check
>>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
... 'mypassword')
True
>>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
... 'anotherpassword')
False