@@ -2,11 +2,7 @@ package com.darkrockstudios.app.securecamera.security.schemes
22
33import android.content.Context
44import android.security.keystore.KeyGenParameterSpec
5- import android.security.keystore.KeyProperties.BLOCK_MODE_GCM
6- import android.security.keystore.KeyProperties.ENCRYPTION_PADDING_NONE
7- import android.security.keystore.KeyProperties.KEY_ALGORITHM_AES
8- import android.security.keystore.KeyProperties.PURPOSE_DECRYPT
9- import android.security.keystore.KeyProperties.PURPOSE_ENCRYPT
5+ import android.security.keystore.KeyProperties.*
106import android.security.keystore.StrongBoxUnavailableException
117import com.darkrockstudios.app.securecamera.preferences.AppSettingsDataSource
128import com.darkrockstudios.app.securecamera.preferences.HashedPin
@@ -60,10 +56,10 @@ class HardwareBackedEncryptionScheme(
6056
6157 val cipheredDsalt = dSaltFile.readBytes()
6258 val plainDsalt = decryptWithHardwareBackedKey(cipheredDsalt)
63- val encodedDsalt = Base64 .Default . encode(plainDsalt)
59+ val encodedDsalt = Base64 .encode(plainDsalt)
6460
6561 val deviceId = deviceInfo.getDeviceIdentifier()
66- val encodedDeviceId = Base64 .Default . encode(deviceId)
62+ val encodedDeviceId = Base64 .encode(deviceId)
6763
6864 val dekInput =
6965 plainPin.toByteArray(Charsets .UTF_8 ) + encodedDsalt.toByteArray(Charsets .UTF_8 ) + encodedDeviceId.toByteArray(
@@ -134,10 +130,10 @@ class HardwareBackedEncryptionScheme(
134130 SecureRandom .getInstanceStrong().nextBytes(dSalt)
135131
136132 // Derive the key
137- val encodedDsalt = Base64 .Default . encode(dSalt)
133+ val encodedDsalt = Base64 .encode(dSalt)
138134
139135 val deviceId = deviceInfo.getDeviceIdentifier()
140- val encodedDeviceId = Base64 .Default . encode(deviceId)
136+ val encodedDeviceId = Base64 .encode(deviceId)
141137
142138 val dekInput =
143139 plainPin.toByteArray(Charsets .UTF_8 ) + encodedDsalt.toByteArray(Charsets .UTF_8 ) + encodedDeviceId.toByteArray(
0 commit comments