mobile-weak-crypto
Installation
SKILL.md
Mobile Weak Cryptography
What Is Broken and Why
Mobile apps frequently implement cryptography incorrectly: using broken algorithms (DES, RC4), insecure modes (ECB), static/reused IVs, hardcoded keys embedded in source or resources, or non-cryptographic RNGs for key generation. Android's java.util.Random is not a CSPRNG. iOS's arc4random() is acceptable but older code uses rand(). ECB mode leaks plaintext patterns in ciphertext. Hardcoded keys are extractable via static analysis of the APK or IPA in seconds.
Key Signals
Cipher.getInstance("AES/ECB/NoPadding")orCipher.getInstance("DES/...")in Android codekCCAlgorithmDES,kCCAlgorithmRC4in iOS CommonCrypto calls- Hardcoded hex/base64 strings adjacent to crypto API calls
new Random()orMath.random()used to generate keys or IVsarc4random()replaced byrand()or custom PRNG in security-critical iOS code- Static byte arrays used as IV:
byte[] iv = {0,0,0,0,...} SecretKeySpecinitialized directly from a string literal:new SecretKeySpec("hardcoded".getBytes(), "AES")- RSA without OAEP:
Cipher.getInstance("RSA/ECB/PKCS1Padding") - Key sizes below 128-bit (AES), 2048-bit (RSA), 256-bit (EC)