Skip to content

Commit

Permalink
Docs improvements and corrections
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Mar 29, 2021
1 parent 0c499bf commit b9b77e3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ vault password and stores that in the keyring facility of your local system
using the `keyring package`_. Subsequent encryption and decryption of the vault
file will then use the password from the keyring, avoiding any further password
prompts. Programmatic access can also be done with the password from the
keyring. The use of the keyring facility can be disabled if that is desired.
keyring.

The encryption of the vault files is implemented using the 'fernet'
The encryption of the vault files is implemented using the symmetric key
functionality of the `cryptography package`_.

One use case for this package is for example the daily work with programs that
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ API Reference

This section describes the API of the **easy-vault** package. The API is
kept stable using the compatibility rules defined for
:term:`semantic versioning`.
`semantic versioning <https://semver.org/>`_.

Any functions not described in this section are considered internal and may
change incompatibly without warning.
Expand Down
6 changes: 0 additions & 6 deletions docs/appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ References

.. glossary::

cryptography package
`cryptography package on Pypi <https://pypi.org/project/cryptography/>`_

Semantic versioning
`Semantic versioning 2.0 <https://semver.org/>`_

Python glossary
* `Python 2.7 Glossary <https://docs.python.org/2.7/glossary.html>`_
* `Python 3.9 Glossary <https://docs.python.org/3.9/glossary.html>`_
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ vault password and stores that in the keyring facility of your local system
using the `keyring package`_. Subsequent encryption and decryption of the vault
file will then use the password from the keyring, avoiding any further password
prompts. Programmatic access can also be done with the password from the
keyring. The use of the keyring facility can be disabled if that is desired.
keyring.

The encryption of the vault files is implemented using the 'fernet'
The encryption of the vault files is implemented using the symmetric key
functionality of the `cryptography package`_.

One use case for this package is for example the daily work with programs that
Expand Down
10 changes: 4 additions & 6 deletions easy_vault/_easy_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class EasyVault(object):
The encryption package used by this class is pluggable. The default
implementation uses the symmetric key support from the
:term:`cryptography package`.
`cryptography package <https://pypi.org/project/cryptography/>`_.
Users who whish to use a different encryption package can do so by
subclassing this class and implementing the following methods to use a
Expand Down Expand Up @@ -373,8 +373,9 @@ def generate_key(password):
This method can be overwritten by users to use a different encryption
package. Its default implementation uses the
:term:`cryptography package`, and calculates the key as a 256-bit key
using 10000 iterations of SHA256 on the password, using a fixed salt.
`cryptography package <https://pypi.org/project/cryptography/>`_,
and calculates the key as a 256-bit key using 10000 iterations of
SHA256 on the password, using a fixed salt.
Parameters:
Expand All @@ -384,9 +385,6 @@ def generate_key(password):
Returns:
:term:`byte string`: The calculated key.
"""
# TODO: Move to random salt, e.g. os.urandom(16). This requires storing
# the key in the keyring instead of the password and requires
# managing the keys on behalf of the user.
salt = b'fixed'
bpassword = password.encode('utf-8')
kdf = PBKDF2HMAC(
Expand Down

0 comments on commit b9b77e3

Please sign in to comment.