---
source: crates/ruff/src/rules/flake8_bandit/mod.rs
---
S324.py:7:13: S324 Probable use of insecure hash functions in `hashlib`: `md5`
   |
 7 | # Invalid
 8 | 
 9 | hashlib.new('md5')
   |             ^^^^^ S324
10 | 
11 | hashlib.new('md4', b'test')
   |

S324.py:9:13: S324 Probable use of insecure hash functions in `hashlib`: `md4`
   |
 9 | hashlib.new('md5')
10 | 
11 | hashlib.new('md4', b'test')
   |             ^^^^^ S324
12 | 
13 | hashlib.new(name='md5', data=b'test')
   |

S324.py:11:18: S324 Probable use of insecure hash functions in `hashlib`: `md5`
   |
11 | hashlib.new('md4', b'test')
12 | 
13 | hashlib.new(name='md5', data=b'test')
   |                  ^^^^^ S324
14 | 
15 | hashlib.new('MD4', data=b'test')
   |

S324.py:13:13: S324 Probable use of insecure hash functions in `hashlib`: `MD4`
   |
13 | hashlib.new(name='md5', data=b'test')
14 | 
15 | hashlib.new('MD4', data=b'test')
   |             ^^^^^ S324
16 | 
17 | hashlib.new('sha1')
   |

S324.py:15:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
   |
15 | hashlib.new('MD4', data=b'test')
16 | 
17 | hashlib.new('sha1')
   |             ^^^^^^ S324
18 | 
19 | hashlib.new('sha1', data=b'test')
   |

S324.py:17:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
   |
17 | hashlib.new('sha1')
18 | 
19 | hashlib.new('sha1', data=b'test')
   |             ^^^^^^ S324
20 | 
21 | hashlib.new('sha', data=b'test')
   |

S324.py:19:13: S324 Probable use of insecure hash functions in `hashlib`: `sha`
   |
19 | hashlib.new('sha1', data=b'test')
20 | 
21 | hashlib.new('sha', data=b'test')
   |             ^^^^^ S324
22 | 
23 | hashlib.new(name='SHA', data=b'test')
   |

S324.py:21:18: S324 Probable use of insecure hash functions in `hashlib`: `SHA`
   |
21 | hashlib.new('sha', data=b'test')
22 | 
23 | hashlib.new(name='SHA', data=b'test')
   |                  ^^^^^ S324
24 | 
25 | hashlib.sha(data=b'test')
   |

S324.py:23:1: S324 Probable use of insecure hash functions in `hashlib`: `sha`
   |
23 | hashlib.new(name='SHA', data=b'test')
24 | 
25 | hashlib.sha(data=b'test')
   | ^^^^^^^^^^^ S324
26 | 
27 | hashlib.md5()
   |

S324.py:25:1: S324 Probable use of insecure hash functions in `hashlib`: `md5`
   |
25 | hashlib.sha(data=b'test')
26 | 
27 | hashlib.md5()
   | ^^^^^^^^^^^ S324
28 | 
29 | hashlib_new('sha1')
   |

S324.py:27:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
   |
27 | hashlib.md5()
28 | 
29 | hashlib_new('sha1')
   |             ^^^^^^ S324
30 | 
31 | hashlib_sha1('sha1')
   |

S324.py:29:1: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
   |
29 | hashlib_new('sha1')
30 | 
31 | hashlib_sha1('sha1')
   | ^^^^^^^^^^^^ S324
32 | 
33 | # usedforsecurity arg only available in Python 3.9+
   |

S324.py:32:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1`
   |
32 | # usedforsecurity arg only available in Python 3.9+
33 | hashlib.new('sha1', usedforsecurity=True)
   |             ^^^^^^ S324
34 | 
35 | # Valid
   |


