Contents
How do I store my secret key?
1 Answer
- Create a key pair at your server, store public and private keys. …
- Include the public key in your application;
- The application uses a secure random generator to create an AES key;
- The data is encrypted using CBC and PKCS#7 padding, also include a HMAC (possibly with yet another random AES key);
Where are Android secret keys stored?
For storing fixed API keys, the following common strategies exist for storing secrets in your source code:
- Hidden in BuildConfigs.
- Embedded in resource file.
- Obfuscating with Proguard.
- Disguised or Encrypted Strings.
- Hidden in native libraries with NDK.
- Hidden as constants in source code.