What is my problem with this file decryption? (Kotlin/AndroidStudio)
I'm writing an app that let's you connect to a remote computer via ssh.
I want to keep the ssh key protected, so my idea is to encrypt it, then decrypt it inside of the app.
Here's the function I'm using:
fun decryptFileWithPBKDF2(
encryptedFile: File,
decryptedFile: File,
password: String,
iterations: Int = 10000,
keyLength: Int = 256
) {
val saltSize = 8 // OpenSSL salt is 8 bytes
val ivSize = 16 // AES block size is 16 bytes...