apache / tsfile

Apache TsFile
https://tsfile.apache.org/
Apache License 2.0
104 stars 50 forks source link

Fix code scanning alert no. 10: Use of a broken or risky cryptographic algorithm #285

Closed HTHou closed 2 weeks ago

HTHou commented 2 weeks ago

Fixes https://github.com/apache/tsfile/security/code-scanning/10

To fix the problem, we need to replace the use of the MD5 algorithm with a stronger, modern cryptographic algorithm such as SHA-256. This change will ensure that the generated encryption key is more secure and less vulnerable to attacks. The specific changes involve updating the MessageDigest.getInstance("MD5") call to MessageDigest.getInstance("SHA-256") and ensuring that the rest of the code correctly handles the longer hash output produced by SHA-256.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.