--- a/cubicweb/crypto.py Thu May 16 01:23:51 2019 +0200
+++ b/cubicweb/crypto.py Thu May 16 17:17:42 2019 +0200
@@ -36,12 +36,13 @@
def encrypt(data, seed):
string = pickle.dumps(data)
- string = string + '*' * (8 - len(string) % 8)
+ string = string + b'*' * (8 - len(string) % 8)
string = b64encode(_cypherer(seed).encrypt(string))
- return unicode(string)
+ return string.decode('utf-8')
def decrypt(string, seed):
+ string = string.encode('utf-8')
# pickle ignores trailing characters so we do not need to strip them off
string = _cypherer(seed).decrypt(b64decode(string))
return pickle.loads(string)