dmrtd
dmrtd copied to clipboard
AES key length is not equal to AES block size
Dutch Passports have a AES256 bit key length. The assumption that the block size which is always 16 bytes (128 bits) with AES is also the key length is simply incorrect. This PR fixes #31 on your side but sadly the same issue is made in Pointy Castle.
These are the errors people often encounter.
I/flutter ( 4922): pace FINE: 2025-07-09 14:13:43.293789: Cipher algorithm: AES, Key length: 256 bits
.
.
.
I/flutter ( 7239): pace SEVERE: 2025-07-09 10:25:13.240112: PACE.decryptNonce; Failed: AESCipher.decrypt; AES128 key length must be 128 bits.
I/flutter ( 7239): pace SEVERE: 2025-07-09 10:25:13.240874: PACE(1); Failed: PACE.decryptNonce; Failed: AESCipher.decrypt; AES128 key length must be 128 bits.
I/flutter ( 7239): pace SEVERE: 2025-07-09 10:25:13.241833: PACE key establishment failed: PACE(1); Failed: PACE.decryptNonce; Failed: AESCipher.decrypt; AES128 key length must be 128 bits.
I/flutter ( 7239): mrtdeg.app SEVERE: 2025-07-09 10:25:13.243160: An exception was encountered while trying to read Passport: PACE key establishment failed: PACE(1); Failed: PACE.decryptNonce; Failed: AESCipher.decrypt; AES128 key length must be 128 bits.
Thank you for providing this PR! Could you please re-base it to develop branch.