Closed szszszsz closed 1 year ago
This should not be the device's job.
Increasing the number of hash rounds is a compromise between slower verification and slower brute force attacks. Since the SOC we use are much much slower than any hardware an attacker would use, unlocking the PIN would have to take minutes to barely slow down an attacker.
Ideally the host would deal with this, through some mechanism like KDF-DO, since the host generally has much more computing power than the device. The host also has significantly much more RAM, which means it can use memory-hard and cache-hard functions like Argon2 rather than just running HASH rounds.
I agree it should not be, but it is. Should we disable opcard's non-KDFDO use then? Edit: what about PIV?
PIV doesn't have that kind of functionality
Yup, I know. Just showing, that not all apps have it available.
It still doesn't make it useful to do it on the device.
Can you support your claim?
After discussion, this is not a goal of this backend, as it is rather intended to focus cooperating with the security element instead. Closing as won't fix.
Currently only one HMAC round is run during KDF for the PIN-based encryption key. It should be increased as much as possible, to extend time needed for the brute-force hashing attacks aiming for the key recovery.
https://github.com/trussed-dev/trussed-auth/blob/main/src/backend/data.rs#L471-L479