Description
Feature description
Implement encrypt and decrypt in the termux-keystore
(currently it only supports signing and verifying) via Cipher
This would enable passcodes, secrets, et cetera to be stored in the Android KeyStore, an example would be for automatic decryption of an rclone config file without storing the password in a text file (e.g. encrypted by gpg) using rclone's --password-command
, and would enable easy integration with the FingerprintAPI
/Biometric Authentication, which would resolve #246 and would also be more convenient than a passphrase or using pass (possibly more secure)
Reference implementation
- Using the KeyGenParameterSpec.Builder with PURPOSE_ENCRYPT | PURPOSE_DECRYPT, as well as examples of encrypting and decrypting a text with Cipher (this example would need to store the IV)
- LokileCrypt is an implemented example of Android KeyStore supporting encryption/decryption, it merges the encrypted data and a random IV header, as already supported with
cipher.getIV()
which may be preferable so the IV is not stored separately. termux-keystore can also set a constant IV usingIVParameterSpec
but not preferable or derived from the alias, secret, such as what rclone does - How to get key from keystore on successful fingerprint auth
- Android Fingerprint API Encryption and Decryption
- Implement Cipher Encrypt/Decrypt
- Support Encrypt/Decrypt purposes, Termux currently uses 12 for sign+verify
- Update to API level 30 by replacing
setUserAuthenticationValidityDurationSeconds
withsetUserAuthenticationParameters
- Support non-Biometric
AUTH_DEVICE_CREDENTIAL
(see above) - Credential/Biometric Prompt if key locked
- Option to keep key validated if Biometric enrollment changed using
setInvalidatedByBiometricEnrollment
- Random IV header constructor and reader
Metadata
Metadata
Assignees
Labels
No labels