You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
Hi,
I am generating cipher for my token and CVV then saving both in sharedPref. Next time for any token am generating again cipher. Checking if that cipher exists in sharedPref. If it exists I am reading the CVV cipher against this token cipher. Later am trying to decrypt this CVV cipher. But it seems everytime I try to generate cipher for same String, am getting different cipher. Can I have the same cipher for given String?
The text was updated successfully, but these errors were encountered:
Hi, I'm not sure if I follow. Maybe a little code example should help me understand.
Let me see if I got your question: you are encrypting twice the same plain data, and then you get different outputs each time, right?
That is correct. The resulting cipher data is result (besides the algorithm used of course), the key and the initialization vector (IV). The IV is randomly generated for each encryption. That is important because an attacker cannot infer any information about the key by trying different specially crafted data. Failing to use strong random IV's is a vulnerability.
I'm assuming that the encryption key is the same. If you are using the provided SharedPrefsKeyChain it should be the case as it generates a random key the first time, and from then on, uses it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am generating cipher for my token and CVV then saving both in sharedPref. Next time for any token am generating again cipher. Checking if that cipher exists in sharedPref. If it exists I am reading the CVV cipher against this token cipher. Later am trying to decrypt this CVV cipher. But it seems everytime I try to generate cipher for same String, am getting different cipher. Can I have the same cipher for given String?
The text was updated successfully, but these errors were encountered: