oblador / react-native-keychain

:key: Keychain Access for React Native
MIT License
3.18k stars 519 forks source link

Encrypt a value without storing it #605

Open pasquale95 opened 1 year ago

pasquale95 commented 1 year ago

Hi, I open this issue to know if there's a way I can encrypt a value with an hardware key and get back the encrypted result without storing such result in the app space. From the documentation it seems that there is no way to get the encrypted value. Any suggestion?

Thanks!

fendorio commented 8 months ago

You would create an encryption key using this library, and have the encryption key stored in the keychain/keystore, then use that to encrypt your data, depending on the nature of your requirements, you could simply store the encrypted data with the AsyncStorage API.

Create encryption key with this library Use that key to encrypt your data Save the encrypted data (string) with AsyncStorage for example Retrieve encryption key with this library to decrypt the data.