Potentially Cryptographic Vulnerability: Insecure Algorithm

Description

The mode of operation used to encrypt the data is vulnerable. If AES is used without specifying the mode, the default mode is the insecure ECB mode.

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/Cipher;', 'getInstance', '(Ljava/lang/String;)Ljavax/crypto/Cipher;', '0', 'CRYPTO_SINK']' [[('Lcom/dimelo/purpleshop/firebase/GcmIntentService;', 'onHandleIntent', '(Landroid/content/Intent;)V'), ('Lcom/dimelo/purpleshop/activities/MainActivity;', 'setupDimelo', '(Landroid/content/Context;)Lcom/dimelo/dimelosdk/main/Dimelo;'), ('Lcom/dimelo/purpleshop/activities/MainActivity;', 'decrypt', '([B)Ljava/lang/String;'), ('Ljavax/crypto/Cipher;', 'getInstance', '(Ljava/lang/String;)Ljavax/crypto/Cipher;')]]

The insecure algorithm AES is used.

Method com.dimelo.purpleshop.firebase.GcmIntentService.onHandleIntent():

Couldn't retrieve source code

Method com.dimelo.purpleshop.activities.MainActivity.setupDimelo():


    public static com.dimelo.dimelosdk.main.Dimelo setupDimelo(android.content.Context p3)
    {
        com.dimelo.dimelosdk.main.Dimelo.setup(p3);
        com.dimelo.dimelosdk.main.Dimelo v3_1 = com.dimelo.dimelosdk.main.Dimelo.getInstance();
        try {
            com.dimelo.purpleshop.activities.MainActivity.secret = com.dimelo.purpleshop.activities.MainActivity.decrypt(com.dimelo.purpleshop.application.Constant.SECRET);
        } catch (Exception) {
        }
        v3_1.initWithApiSecret(com.dimelo.purpleshop.activities.MainActivity.secret, "domain-test", 0);
        return v3_1;
    }

Method com.dimelo.purpleshop.activities.MainActivity.decrypt():


    private static String decrypt(byte[] p3)
    {
        String v0_3 = new javax.crypto.spec.SecretKeySpec(com.dimelo.purpleshop.activities.MainActivity.keyValue, "AES");
        javax.crypto.Cipher v1_2 = javax.crypto.Cipher.getInstance("AES");
        v1_2.init(2, v0_3);
        return new String(v1_2.doFinal(p3));
    }

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