CC_MD5 deprecation migration
See original GitHub issueCurrent behavior
Currently Async Storage iOS relies on RCTMD5Hash
which uses CC_MD5
to create a file hash https://github.com/react-native-community/async-storage/blob/af2664e5334175a180d71e22fe10e184904d63ff/ios/RNCAsyncStorage.m#L365
CC_MD5 was deprecated in iOS 13 due to not being cryptographically correct.
‘CC_MD5’ is deprecated: first deprecated in macOS 10.15 - This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).
This initially brought up in React Native core, https://github.com/facebook/react-native/issues/29590
Expected behavior
Either migrate to a SHA256 encryption or use a cryptographically correct MD5 hash package.
I’m assuming a SHA256 encryption would be better as it won’t introduce a new dependency. This might be just a change in React Native core, unless it would be better for Async Storage to own that functionality.
I’ll make the PR for these, just want to confirm which direction is best to go.
Repro steps
Build React Native app with async-storage & targeting iOS 13.
‘CC_MD5’ is deprecated: first deprecated in macOS 10.15 - This function is cryptographically broken and should not be used in security contexts. Clients should migrate to SHA256 (or stronger).
Warning should show up.
Environment
- Async Storage version: 1.11.0
- React-Native version: 0.63
- Platform tested: iOS
- Logs/Error that are relevant: N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
@safaiyeh Thanks for raising this up. Yes, we agreed that SHA256 is better, among those two. Because we’re changing the filenames used, we have to create a migration process too. Here’s how I see it:
Right, but the MD5 algorithm itself is compromised, regardless of the implementation. (Sorry, I think I’m communicating this poorly.) Either way, SHA256 sounds good!