question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update MD5 usages with Cryptographically secure SHA256

See original GitHub issue

Prerequisites

Description

Upgrading to JDK 11 and NB11 means some methods are deprecated, to prepare for this, some usages will need to be handled accordingly.

From this comment The postToNifi method I think we can change it to support SHA256 based on https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.11.1/org.apache.nifi.processors.standard.HashContent/.

A global project search may need to be done to ensure other usages of HashContent.md5() are not hiding somewhere.

Testing to ensure no behavioural changes are made and any subsequent methods which read from the hashed values still function as intended.

Steps to Reproduce

N/A

Expected behaviour:

Actual behaviour:

Reproduces how often:

Additional Information

Although this change is a deprecation, it is useful to implement since the md5 is not cryptographically secure.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arcturus2commented, Mar 17, 2020

Thinking about it further, I’d vote to replace it with SHA256 so that we are more future proof and don’t have to worry about when it is removed from the JDK.

Agreed in terms of speed it will be better to stay with MD5. For my use case I don’t call createMD5Hash often so I can take the performance hit.

0reactions
cygnus-x-1commented, Mar 17, 2020

Okay, will do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

To scram-sha-256 from MD5 in PostgreSQL- CYBERTEC
This article explains in simple steps how to improve security in PostgreSQL by converting from MD5 hashes to scram-sha-256.
Read more >
hashlib — Secure hashes and message digests ... - Python Docs
This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1,...
Read more >
MD5 vs SHA-1 vs SHA-2 - Which is the Most Secure ...
Performance-wise, a SHA-256 hash is about 20-30% slower to calculate than either MD5 or SHA-1 hashes. SHA-3. This hash method was developed in ......
Read more >
SHA-256 or MD5 for file integrity - hash - Stack Overflow
Both SHA256 and MDA5 are hashing algorithms. They take your input data, in this case your file, and output a 256/128-bit number. This...
Read more >
Top Hashing Algorithms In Cryptography | MD5 and SHA 256 ...
Cyber Security Playlist [2023 Updated ] ... We cover the basics of cryptography and its applications. We also have detailed MD5...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found