Electric-Coin-Company / zcash-android-wallet-sdk

Native Android SDK for Zcash
MIT License
5 stars 9 forks source link

[SDK audit] Recommendation: Use SHA256 instead of SHA1 for parameter file integrity checks #1459

Open HonzaR opened 4 months ago

HonzaR commented 4 months ago

Is your feature request related to a problem? Please describe.

The SDK uses the SHA1 to check that the correct parameter files have been downloaded. SHA1 is vulnerable to collision attacks, so it should be replaced with SHA256 or another secure hash function. This is not a security risk, since SHA1 is still secure against second-preimage attacks (which is what would be needed to get the wallet to accept bad parameter files), nevertheless SHA1 should still be avoided.

Describe the solution you'd like

Check and refactor File.getSha1Hash(): String API

Alternatives you've considered

Additional context