Securing Stored Data in Android: Implementing Encryption with Keystore API
Protecting user data goes far beyond just storing it. It’s about storing it securely. In this hands-on codelab, you’ll learn how to protect sensitive information in your Android apps using the Keystore API and robust encryption techniques. You’ll explore real-world threats, understand when to use AES or RSA encryption, and implement secure storage with DataStore and Manual Encryption Techniques. Along the way, you’ll get practical insights into key generation, hardware-backed security, and performance considerations for encrypting files and databases to help you build safer, more secure applications.
Codelab Objectives
In this codelab, you’ll explore:
-
Learn why encrypting stored data is necessary to protect user privacy
-
Fundamentals of Securing Data at Rest and Data in Transit
-
Explore common security threats: rooted devices, file system access, and database leaks
-
Learn the differences between symmetric and asymmetric encryption
-
Understanding Secure Storage with Android Keystore
-
Explore the benefits of hardware-backed security (StrongBox) vs. software-based encryption
-
Understand AES (Advanced Encryption Standard) and RSA encryption in Android
-
Understand when to use AES vs. RSA encryption for different data types
-
Implementing Encryption Techniques
-
Use KeyGenParameterSpec to configure key generation parameters
-
Extract and Inspect SharedPreferences Using ADB
-
Storing Sensitive Data Securely: DataStore with Manual Encryption Techniques
-
Learn how attackers can extract sensitive data from an unprotected app
-
Optimize performance when encrypting large files and databases
-
Deploying Secure Applications and security best practices
Codelab Content
More courses by the instructor