Преглед на файлове

Replace ECB mode with CBC mode

Quoting @Legrandin in

https://github.com/Legrandin/pycryptodome/issues/28

> The online API docs have been updated so that iv (or IV) does not show
> up as a parameter applicable to ECB anymore.

> It is correct that IV is silently accepted (and immediately discarded)
> for ECB mode in PyCrypto, and one may expect that keeps working with
> PyCrytodome (which is a kind of drop-in replacement). However, as much
> as I hate breaking APIs, it was an explicit choice not to continue with
> such dangerous and highly misleading behavior.

> I recommend you update your application so that it either does not use
> the IV parameter in case of ECB or move to a more secure mode that does
> employ such extra data.

Woah, PyCrypto was a dangerous stuff ...
Oz N Tiram преди 8 години
родител
ревизия
1fc881b240
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      pwman/util/crypto/crypto_engine.py

+ 1 - 1
pwman/util/crypto/crypto_engine.py

@@ -99,7 +99,7 @@ def get_cipher(password, salt):
     """
     iv = os.urandom(AES.block_size)
     dig = get_digest(password, salt)
-    chiper = AES.new(dig, AES.MODE_ECB, iv)
+    chiper = AES.new(dig, AES.MODE_CBC, iv)
     return chiper