Potentially Cryptographic Vulnerability: Insecure Algorithm

Description

The mode of operation used to encrypt the data is vulnerable

Recommendation

We recommend AES for general-purpose use. If you're willing to go against the grain and are paranoid, you can use Serpent, which isn't quite as fast as AES but is believed to have a much higher security margin.

If you really feel that you need the fastest possible secure solution, consider the SNOW 2.0 stream cipher, which currently looks very good. It appears to have a much better security margin than the popular favorite, RC4, and is even faster. However, it is fairly new. If you're highly risk-adverse, we recommend AES or Serpent. Although popular, RC4 would never be the best available choice.

Technical details
[TAINT] String 'AES' ==>>> Sink '['Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;', '0', 'CRYPTO_SINK']' [[('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'initCipher', '()Z'), ('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'createKey', '()V'), ('Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;')]]

The insecure algorithm AES is used.

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.initCipher():


    private boolean initCipher()
    {
        try {
            if (this.mKeyStore == null) {
                this.mKeyStore = java.security.KeyStore.getInstance("AndroidKeyStore");
            }
        } catch (javax.crypto.NoSuchPaddingException) {
            return 0;
        }
        this.createKey();
        this.mKeyStore.load(0);
        javax.crypto.SecretKey v0_3 = ((javax.crypto.SecretKey) this.mKeyStore.getKey("my_key", 0));
        this.mCipher = javax.crypto.Cipher.getInstance("AES/CBC/PKCS7Padding");
        this.mCipher.init(1, v0_3);
        return 1;
    }

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey():


    public void createKey()
    {
        try {
            this.mKeyGenerator = javax.crypto.KeyGenerator.getInstance("AES", "AndroidKeyStore");
            this.mKeyGenerator.init(new android.security.keystore.KeyGenParameterSpec$Builder("my_key", 3).setBlockModes(new String[] {"CBC"})).setUserAuthenticationRequired(1).setEncryptionPaddings(new String[] {"PKCS7Padding"})).build());
            this.mKeyGenerator.generateKey();
            return;
        } catch (java.security.NoSuchProviderException v0_2) {
            throw new RuntimeException(v0_2);
        }
    }

Method javax.crypto.KeyGenerator.getInstance() not found.

[TAINT] String 'AES' ==>>> Sink '['Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;', '0', 'CRYPTO_SINK']' [[('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'createKey', '()V'), ('Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;')]]

The insecure algorithm AES is used.

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey():


    public void createKey()
    {
        try {
            this.mKeyGenerator = javax.crypto.KeyGenerator.getInstance("AES", "AndroidKeyStore");
            this.mKeyGenerator.init(new android.security.keystore.KeyGenParameterSpec$Builder("my_key", 3).setBlockModes(new String[] {"CBC"})).setUserAuthenticationRequired(1).setEncryptionPaddings(new String[] {"PKCS7Padding"})).build());
            this.mKeyGenerator.generateKey();
            return;
        } catch (java.security.NoSuchProviderException v0_2) {
            throw new RuntimeException(v0_2);
        }
    }

Method javax.crypto.KeyGenerator.getInstance() not found.

[TAINT] String 'AES' ==>>> Sink '['Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;', '0', 'CRYPTO_SINK']' [[('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'startListening', '()V'), ('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'initCipher', '()Z'), ('Lcom/github/orangegangsters/lollipin/lib/managers/FingerprintUiHelper;', 'createKey', '()V'), ('Ljavax/crypto/KeyGenerator;', 'getInstance', '(Ljava/lang/String; Ljava/lang/String;)Ljavax/crypto/KeyGenerator;')]]

The insecure algorithm AES is used.

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.startListening():


    public void startListening()
    {
        if (this.initCipher()) {
            android.hardware.fingerprint.FingerprintManager$CryptoObject v2_1 = new android.hardware.fingerprint.FingerprintManager$CryptoObject(this.mCipher);
            if (this.isFingerprintAuthAvailable()) {
                this.mCancellationSignal = new android.os.CancellationSignal();
                this.mSelfCancelled = 0;
                this.mFingerprintManager.authenticate(v2_1, this.mCancellationSignal, 0, this, 0);
                this.mIcon.setImageResource(com.github.orangegangsters.lollipin.lib.R$drawable.ic_fp_40px);
            } else {
                return;
            }
        }
        return;
    }

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.initCipher():


    private boolean initCipher()
    {
        try {
            if (this.mKeyStore == null) {
                this.mKeyStore = java.security.KeyStore.getInstance("AndroidKeyStore");
            }
        } catch (javax.crypto.NoSuchPaddingException) {
            return 0;
        }
        this.createKey();
        this.mKeyStore.load(0);
        javax.crypto.SecretKey v0_3 = ((javax.crypto.SecretKey) this.mKeyStore.getKey("my_key", 0));
        this.mCipher = javax.crypto.Cipher.getInstance("AES/CBC/PKCS7Padding");
        this.mCipher.init(1, v0_3);
        return 1;
    }

Method com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey():


    public void createKey()
    {
        try {
            this.mKeyGenerator = javax.crypto.KeyGenerator.getInstance("AES", "AndroidKeyStore");
            this.mKeyGenerator.init(new android.security.keystore.KeyGenParameterSpec$Builder("my_key", 3).setBlockModes(new String[] {"CBC"})).setUserAuthenticationRequired(1).setEncryptionPaddings(new String[] {"PKCS7Padding"})).build());
            this.mKeyGenerator.generateKey();
            return;
        } catch (java.security.NoSuchProviderException v0_2) {
            throw new RuntimeException(v0_2);
        }
    }

Method javax.crypto.KeyGenerator.getInstance() not found.