The most common way to encrypt keystores is with a password, but this is optional.
Saving a password close to the keystore is more or less equivalent to having a keystore that is not encrypted. This can be perfectly normal. For example, it is not uncommon to have unencrypted keystores with both certificates, private keys on servers where the keystore file is protected by other means.
The type of attack that you seem to be trying to defend against this is that someone could modify the contents of the keystore. The password can be used to verify the integrity of the keystore, but only if it is not known to the attacker. He cannot think of a typical scenario where an attacker will have access to your keystore, but will not have access to the bytecode of your application or other application configuration.
The file system for an Android application is reasonably protected, but not bulletproof. If you do not trust this file system, you need to encrypt the keystore with a password that the user enters or retrieves from another location outside the device. On the other hand, if you trust the file system, you actually do not need to encrypt the keystore (or you can encrypt it with a well-known password if this will simplify your development).
sstendal
source share