-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security consideration info #28
Comments
MKEK is a random AES-256 secret key that is salted by your hashed PIN. Despite it has billions of possibilities, the input to that system is your PIN. So, the larger is the better protection offers. If your flash gets dumped offline it can be cracked by brute-force by introducing PIN values. Doing a quick calculus, using 4 RTX 3090 Ti, they could perform 512 x 10^6 hashes per second. For a 8-bytes PIN length in plain text (ASCII number 0-9) in few seconds would be cracked. If you use 8-bytes PIN length in HEX it will require thousands of years. However, HEX mode depends on client implementation (opensc I think uses ASCII mode). For this reason, we provide alternative methods:
These are not the optimal solutions, but this is due to Raspberry Pico, which is not designed as an homologated secure hardware device. We can add as many layers of security as we can, but at the end the flash memory can be always dumped, which is not a good deal for high security standards. |
Thanks I think you should put a warning on pin security limitation. I look at the code hash_multi is based on sha256 with serial injection and 256 input len (pin is repeated several time) What is the purpose of 256 iter in hash_multi ? Both pin and sopin need to be good to keep mkek secret What are the specification of pin and sopin in sc-hsm protocol ? https://github.com/OpenSC/OpenSC/wiki/SmartCardHSM#initialize-the-device |
These are legacy functions defined by OpenPGP. The purpose of xor'ng pin in double_hash_pin is to change the input of second hash_multi. sc-hsm is not a protocol, but a vendor solution from CardContact. PKCS11 interface defines PIN authorization but is up to implementation how is encoded. As you noted, so-pin expects 16 HEX string, but there is no limitation on PIN length (like 8 or 10 bytes). It is sent as ASCII, so if you pass |
@polhenarejos Is it better to state this situation in readme? The current description in readme is slightly misleading.
People who are not familiar with the project may easily mistaken that even if the pico hsm is lost, their keys are still very secure. |
Could you detail resistance to brute force attack ?
Dumping to flash and try to brute force pin to recover DKEK.
What are the recommended pin len/complexity to prevent brute force attack ?
The text was updated successfully, but these errors were encountered: