diff options
Diffstat (limited to 'conductor')
-rw-r--r-- | conductor/conductor/common/utils/cipherUtils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/conductor/conductor/common/utils/cipherUtils.py b/conductor/conductor/common/utils/cipherUtils.py index 0daf8ba..94c2649 100644 --- a/conductor/conductor/common/utils/cipherUtils.py +++ b/conductor/conductor/common/utils/cipherUtils.py @@ -61,13 +61,13 @@ class AESCipher(object): def encrypt(self, raw): raw = self._pad(raw) iv = Random.new().read(AES.block_size) - cipher = AES.new(self.key, AES.MODE_CBC, iv) + cipher = AES.new(self.key, AES.MODE_GCM, iv) return base64.b64encode(iv + cipher.encrypt(raw)) def decrypt(self, enc): enc = base64.b64decode(enc) iv = enc[:AES.block_size] - cipher = AES.new(self.key, AES.MODE_CBC, iv) + cipher = AES.new(self.key, AES.MODE_GCM, iv) return self._unpad(cipher.decrypt(enc[AES.block_size:])).decode('utf-8') def _pad(self, s): |