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

[Security Bug] Improper Use of Reversible Encryption #59

Open
terryschmidt opened this issue Feb 24, 2021 · 0 comments
Open

[Security Bug] Improper Use of Reversible Encryption #59

terryschmidt opened this issue Feb 24, 2021 · 0 comments

Comments

@terryschmidt
Copy link

Describe the bug
A cursory review of PFLockScreen-Android revealed an improper use of encryption to store the security PIN. The library uses a reversible encryption scheme instead of one-way hashing, which could allow attackers to decrypt encrypted PINs.

To Reproduce
See checkPin() function here:

public void checkPin(Context context, String encodedPin, String pin, PFPinCodeHelperCallback<Boolean> callback) {

To verify a PIN, the application passes both the plain-text PIN and the encrypted version. The library decrypts the encrypted PIN and compares it against the plain-text version.

As seen above, the library decrypted the encrypted PIN and compares it against the plain-text version.

Expected behavior
PFLockScreen-Android should use hashing instead of encrypting the PIN of the user. For instance, the library could be using bcrypt or argon2id to create a strong hash of the PIN combined with a random unique salt.

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

1 participant