keycard-tech / status-keycard

Our Javacard Implementation for making secure transactions within Status and Ethereum
Apache License 2.0
216 stars 66 forks source link

Plausible deniability only works for extended keypairs? #91

Open rkreutz opened 1 year ago

rkreutz commented 1 year ago

Hey @bitgamma

I was having a look at the plausible deniability PR and was wondering if the duress PIN actually worked as the main PIN in case the key pair is not an extended one?

From what I could understand from the codebase, the derived private key only difference between the alt and the main key is the chain code, where the alt chain code is a SHA256 digest of the main chain code, but this is only set if the main key is an extended one, so in case the card was loaded with a plain private key (that doesn't support derivation) would that mean that the duress PIN is effectively signing with the main PIN private key?

Thanks

bitgamma commented 1 year ago

that's true. The reason why we use the same master key is because the keyUID (which is retrieved before pin authentication) depends on the master key so it must remain the same for both PINs to make it work transparently.

Support for non-extended keys is legacy behavior. We will document the incompatibility of non-extended keys with duress PIN and probably in the future support for non-extended keys will be removed altogether