Get error when trying to decrypt String from a ContentProvider
DonalRafferty opened this issue · 2 comments
I am currently using your excellent code to encrypt and decrypt on Android, however I have hit an issue that I don't know how to resolve or what might be causing it.
When I use your code straight up where I encode and decode a simple String it works fine.
However what I need to do is encrypt the String, put it in a Content Provider and then decrypt it when I pull it from the Content Provider.
However when I pull it from the ContentProvider and try to decrypt it I get the following exception:
java.security.GeneralSecurityException: MAC stored in civ does not match computed MAC.
The exact same String works if I decrypt it without putting it into the Content Provider so I am unsure why I am getting this issue?
Can you help me find why this might be occurring?
Sorry my mistake it looks like its not using the correct key when the ContentProvider is called, sorry.
Not really sure what might be going wrong. If the exact same string
decrypts before but not after you put it in the content provider, best
guess is that it's not the same string.
Can you compare the two? Is it getting whitespace or markup added? Is it
getting truncated? Is it getting encoded with something like UTF 8?
peace,
Isaac, sent from a mobile device
On Dec 15, 2015 8:27 AM, "Draffodx" notifications@github.com wrote:
I am currently using your excellent code to encrypt and decrypt on
Android, hoever I have hit an issue that I don't know how to resolve or
what might be causing itWhen I use your code straight up where I encode and decode a simple String
it works fineHowever what I need to do is encrypt the String, put it in a Content
Provider and then decrypt it when I pull it from the Content ProviderHowever when I pull it from the ContentProvider and try to decrypt it I
get the following exception:javasecurityGeneralSecurityException: MAC stored in civ does not match
computed MACThe exact same String works if I decrypt it without putting it into the
Content Provider so I am unsure why I am getting this issue?Can you help me find why this might be occurring?
—
Reply to this email directly or view it on GitHub
#22.