diff options
author | drebs <drebs@leap.se> | 2013-05-12 19:16:16 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-05-13 15:49:33 -0300 |
commit | 3cefb8291c69ff4354f5b4cfde1d92117aac3d26 (patch) | |
tree | 24541105fd58f15a7977bdac5583d99ef8248315 /src/leap/soledad/crypto.py | |
parent | 028cf283c1dae800b2ea70a05201cb9c696be973 (diff) |
Encrypt storage secret using scrypt KDF.
* Change format of storage.
* Refactor and modify export/import recovery documents logic.
* Change storage secret length to 512.
* Encrypt the storage document with derived function.
* Refactor property name inside crypto submodule.
* Add docstrings for new methods.
* Fix wrong method call import_recovery_document.
* Fix base64 encoding and secret/kdf length info.
* Add missing header.
* Add missing fields to comment.
Closes 2475 and 2423.
Diffstat (limited to 'src/leap/soledad/crypto.py')
-rw-r--r-- | src/leap/soledad/crypto.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/leap/soledad/crypto.py b/src/leap/soledad/crypto.py index 9d2227bd..605380ec 100644 --- a/src/leap/soledad/crypto.py +++ b/src/leap/soledad/crypto.py @@ -47,7 +47,7 @@ class SoledadCrypto(object): """ self._soledad = soledad self._pgp = openpgp.OpenPGPScheme(self._soledad) - self._symkey = None + self._secret = None def encrypt_sym(self, data, passphrase): """ @@ -112,19 +112,19 @@ class SoledadCrypto(object): @rtype: str @raise NoSymmetricSecret: if no symmetric secret was supplied. """ - if self._symkey is None: + if self._secret is None: raise NoSymmetricSecret() - return sha256('%s%s' % (self._symkey, suffix)).hexdigest() + return sha256('%s%s' % (self._secret, suffix)).hexdigest() # - # symkey setters/getters + # secret setters/getters # - def _get_symkey(self): - return self._symkey + def _get_secret(self): + return self._secret - def _set_symkey(self, symkey): - self._symkey = symkey + def _set_secret(self, secret): + self._secret = secret - symkey = property(_get_symkey, _set_symkey, + secret = property(_get_secret, _set_secret, doc='The key used for symmetric encryption') |