Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getGenericPassword failing after updating package from 8.2.0 #704

Open
Bowlerr opened this issue Dec 16, 2024 · 6 comments
Open

getGenericPassword failing after updating package from 8.2.0 #704

Bowlerr opened this issue Dec 16, 2024 · 6 comments

Comments

@Bowlerr
Copy link

Bowlerr commented Dec 16, 2024

Title: Incompatibility Between Versions 8.2.0 and 9.2.2 with getGenericPassword

Description:
When upgrading from react-native-keychain version 8.2.0 to 9.2.2/9.2.1, I encountered an error when calling getGenericPassword. The password was set using version 8.2.0, but when attempting to retrieve it in version 9.2.2, the following error occurs:

Wrapped error: The message could not be decrypted successfully. It has either been tampered with or the wrong resource is being decrypted.

Steps to Reproduce:

  1. Set the password using version 8.2.0:
    setGenericPassword('pin', encrypted, {
      service: 'passcode',
      storage: STORAGE_TYPE.FB,
    });
  2. Upgrade to version 9.2.2 or 9.2.1:
  3. Attempt to retrieve the password using:
    await getGenericPassword({ service: 'passcode' });

Observed Behavior:
The getGenericPassword call fails with the error:

Wrapped error: The message could not be decrypted successfully. It has either been tampered with or the wrong resource is being decrypted.

Expected Behavior:
The getGenericPassword call should successfully retrieve the password set in version 8.2.0.

Environment:

  • Devices Tested:
    • OnePlus 12 (Android 14)
    • Pixel 7a (Android 15)
  • React Native Keychain Version:
    • Set: 8.2.0
    • Retrieve: 9.2.2
  • React Native Version: 0.74.5

Additional Notes:
It seems like the encryption format or decryption logic may have changed between the two versions, resulting in backward compatibility issues. If this is expected, could you provide guidance on migrating securely without data loss?

@DorianMazur
Copy link
Collaborator

Hi! I’ll take a look at this soon. Just one quick question: is there a specific reason you’re still using FacebookConceal? It’s outdated and will be removed soon. Are other ciphers affected as well?

@Bowlerr
Copy link
Author

Bowlerr commented Dec 17, 2024

Hi! I’ll take a look at this soon. Just one quick question: is there a specific reason you’re still using FacebookConceal? It’s outdated and will be removed soon. Are other ciphers affected as well?

@DorianMazur I found this issue whilst upgrading from FacebookConceal to AES_GCM_NO_AUTH or AES_GCM depending on if the user wants to use biometrics.

I thought the issue at first was the migration to these storage types but ended up finding the issue was with the upgrading of the package.

@Bowlerr
Copy link
Author

Bowlerr commented Dec 17, 2024

I can check on the other ciphers we use. Currently it is KC which is also being migrated once we can sort this upgrade issue. I haven't had a chance to test this yet but can do today

@Bowlerr
Copy link
Author

Bowlerr commented Dec 23, 2024

So the other storage we used was KC which migrates over to AES_GCM_NO_AUTH without any issues. @DorianMazur

@Bowlerr
Copy link
Author

Bowlerr commented Jan 6, 2025

@DorianMazur hey, hope you've had a wonderful new year and holidays, I was wondering if there's any progress/updates on this ?

@DorianMazur
Copy link
Collaborator

@Bowlerr I will be working on it this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants