Skip to content

Commit 32bf7d6

Browse files
authored
Merge pull request #4256 from fatenhealy/Noblowfish
CWE-327 BrokenCryptoAlgorithm recommendation to AES instead of Blowfish
2 parents d694777 + 03d8fc7 commit 32bf7d6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/ql/src/Security/CWE-327/BrokenCryptoAlgorithm.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<code>pycrypto</code> you must specify the encryption
3434
algorithm to use. The first example uses DES, which is an
3535
older algorithm that is now considered weak. The second
36-
example uses Blowfish, which is a stronger more modern algorithm.
36+
example uses AES, which is a stronger modern algorithm.
3737
</p>
3838

3939
<sample src="examples/broken_crypto.py" />

python/ql/src/Security/CWE-327/examples/broken_crypto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from Crypto.Cipher import DES, Blowfish
1+
from Crypto.Cipher import DES, AES
22

33
cipher = DES.new(SECRET_KEY)
44

55
def send_encrypted(channel, message):
66
channel.send(cipher.encrypt(message)) # BAD: weak encryption
77

88

9-
cipher = Blowfish.new(SECRET_KEY)
9+
cipher = AES.new(SECRET_KEY)
1010

1111
def send_encrypted(channel, message):
1212
channel.send(cipher.encrypt(message)) # GOOD: strong encryption

0 commit comments

Comments
 (0)