pytroll / pytroll/pyresample

Use 'usedforsecurity' flag when using hashing functions for non-security purposes

Open
#452 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
385
Forks
102
Avg merge
4d 2h
Merged PRs (30d)
9

Description

We occasionally use python's hashlib to generate hashes for things like AreaDefinitions. On FIPS-enabled systems, certain hashing algorithms are disabled from use for security reasons. This is common in certain US government organizations. It turns out there is a feature in some versions of Python to say "I know I'm using md5sum and it is not well-suited for security purposes, but I'm not using it for security" by passing a usedforsecurity=False keyword argument to some of the hashing functions. See it discussed here:

https://stackoverflow.com/questions/54717862/how-do-i-know-if-the-usedforsecurity-flag-is-supported-by-hashlib-md5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the project for hashlib calls used to generate hashes for AreaDefinitions, then inspect how those calls behave on FIPS-enabled systems. Check the supported Python versions before applying the usedforsecurity=False option, and add or update tests that confirm non-security hashing works where the flag is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.