Securing Data at Rest: Essential Strategies for Mobile Apps (iOS & Android)
Vaibhav Tripathi
Solutions Architect @ GlobalLogic | Top Programming Voice | Experienced in iOS and Android | Leetcode DSA Expert and Mentor
2. Data Encryption:
3. Secure Shared Preferences
4. File Protection in iOS:
5. SQLCipher (Both):
6. Secure Environmental and SDK Keys
Storing SDK keys locally on devices or storing them in plain text configuration files (e.g., gradle.properties for Android, .plist or .xcconfig for iOS) makes them vulnerable to reverse engineering and unauthorized access.
领英推荐
1. Fetch SDK keys dynamically from secure cloud services, reducing the risk of exposure and allowing for easier key rotation. As an example one can consider using Firebase Remote Config or Optimizely to implement this approach.
2. Implement secure methods for managing and injecting SDK keys during the build process to avoid exposing them in your codebase or configuration files.
2.1 Keeps sensitive keys out of the source code: Store SDK keys in environment variables and reference these variables in your build configuration. This keeps sensitive keys out of the source code and minimizes the risk of exposure.
2.2 Integrate Keys into CI/CD Integration: Integrate these keys into your Continuous Integration/Continuous Deployment (CI/CD) pipelines. Ensure that environment-specific keys are injected securely during the build process, tailored to development, staging, or production environments.
2.3 Encrypted and Restricted Build Environment: Ensure that your build environment is secure, with encrypted storage and restricted access to sensitive data. Use secure communication protocols for transferring keys and sensitive information during the build process.
7. Use Native Development Kit (NDK) for Android
Writing critical code in C/C++ using NDK makes reverse engineering more difficult compared to Java/Kotlin.
Key Principles:
Solutions Architect @ GlobalLogic | Top Programming Voice | Experienced in iOS and Android | Leetcode DSA Expert and Mentor
7 个月The choice of security depends on the requirements we have.? If cloud storage is the best option for my app, then I recommend using a backend service.?A backend service can utilize platforms like AWS or Azure or any other. In addition to providing enhanced security, cloud storage offers greater flexibility and control over the keys. However, it may limit access in offline scenarios. Cloud storage is undoubtedly the most secure option but some time overkill also. It comes with its own limitations, for instance, the app needs to be online to access the keys, as they must be fetched from the cloud. Use Hardware backend device encryption like Keychain if possible, it is safe till the time device is not compromised. Large data storage it is advisable to avoid locally if possible.?
Software Engineer at Vinyl Equity
7 个月Which approach would you suggest if one had to work with AWS services and store the credentials on device?