mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-06 08:42:30 -08:00
Fix Twofish algorithm
This commit is contained in:
1 parent
23e7bf9f89
commit
6a088c58de
1 file changed
+1
-7
@@ -32,13 +32,7 @@ object CipherFactory {
|
||||
|
||||
@Throws(NoSuchAlgorithmException::class, NoSuchPaddingException::class, InvalidKeyException::class, InvalidAlgorithmParameterException::class)
|
||||
fun getTwofish(opmode: Int, key: ByteArray, IV: ByteArray): Cipher {
|
||||
val cipher: Cipher = if (opmode == Cipher.ENCRYPT_MODE) {
|
||||
Cipher.getInstance("Twofish/CBC/ZeroBytePadding")
|
||||
} else {
|
||||
Cipher.getInstance("Twofish/CBC/NoPadding")
|
||||
}
|
||||
// TODO Verify KDB TwoFish
|
||||
// CipherFactory.getInstance("Twofish/CBC/PKCS7PADDING")
|
||||
val cipher: Cipher = Cipher.getInstance("Twofish/CBC/PKCS7PADDING")
|
||||
cipher.init(opmode, SecretKeySpec(key, "AES"), IvParameterSpec(IV))
|
||||
return cipher
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user