Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace MD5 with Blake2 #1550

Merged
merged 6 commits into from
Mar 17, 2025
Merged

Replace MD5 with Blake2 #1550

merged 6 commits into from
Mar 17, 2025

Conversation

SharonHart
Copy link
Contributor

@SharonHart SharonHart commented Mar 13, 2025

Change Description

Replace insecure hash function MD5 with Blake2

This PR fixes issue #1541

Checklist

  • I have reviewed the contribution guidelines
  • I have signed the CLA (if required)
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Sorry, something went wrong.

@SharonHart
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@SharonHart
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@SharonHart SharonHart requested a review from Copilot March 13, 2025 14:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the insecure MD5 hash function with the more secure Blake2b in the hash operator.

  • Updated unit and integration tests to validate Blake2b hash outputs instead of MD5.
  • Adjusted error messages and documentation to reference Blake2b appropriately, with one noted typo in the docs.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
presidio-anonymizer/tests/operators/test_hash.py Updated hash tests to replace MD5 with Blake2b.
presidio-anonymizer/tests/integration/test_anonymize_engine.py Changed integration tests to validate Blake2b output.
docs/anonymizer/index.md Modified documentation to reference Blake2b (note a typo present).
presidio-anonymizer/presidio_anonymizer/operators/hash.py Replaced MD5 with Blake2b in the hash operator implementation.
presidio-anonymizer/README.md Updated README documentation to include Blake2b details.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@omri374 omri374 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@omri374
Copy link
Contributor

omri374 commented Mar 13, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

SharonHart and others added 3 commits March 15, 2025 18:25
Co-authored-by: Omri Mendels <omri374@users.noreply.github.com>
@SharonHart SharonHart requested a review from omri374 March 17, 2025 07:22
@SharonHart
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@omri374 omri374 merged commit a0484dd into main Mar 17, 2025
34 checks passed
@omri374 omri374 deleted the shhart/bug/deprecate-md5-for-blake2 branch March 17, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix code scanning alert - Use of insecure MD2, MD4, MD5, or SHA1 hash function.
2 participants