We need to encrypt SD card in our i.MX6 board so no one can read it and steal our software. I am surprised there is no tutorial on the web how to do it (only how to sign u-boot & kernel — but what's the point if user-space code can still be substituted?) so here is my approach.
So no SPL code can be executed except ours, that authenticates u-boot and does not steal SRK fuses values. No u-boot code can be executed except ours, that authenticates kernel and initrd and does not steal SRK fuses values. Kernel and initrd also do not steal SRK fuses values except for internal usage and when kernel is running no other user-space code can be executed as well so SRK fuses values (which should be used to decrypt rootfs) can't be read by user.
Is my approach correct or are there any security holes left in it that can allow user to extract our rootfs contents?
Using /sys/fsl_otp/HW_OCOTP_SRK? as a secret is insecure because it is just a hash value that can be computed from your signatures public key.
hello Guys,
Where exactly do you think the key for encrypted rootfs should be? Initramfs or eMMC, etc. What is the best practise followed?
Thanks,
Satya
Hello Yurin,
Thanks for the above link. The above works and I have tested it long time ago but I am looking for a solution like
Do you think the concept of encrypted boot (DEK Blob) can be used for decrypting the key that can decrypt the rootfs?
Greets,
Satya
Hello,
I think "the concept of encrypted boot (DEK Blob) can be used for decrypting the key
that can decrypt the rootfs". You can use the rootfs key as part of U-boot (in fixed location).
Regards,
Yuri.
Under the HAB technology the SRK fuses contain the hash of the SRK public key and the fuses
can be read. This restriction may be overcome if BSP uses GUI, does not support terminal program,
JTAG is disabled.
As for encryption boot under i.MX6 : in order to generate a Data Encryption Key (DEK) blob for
encrypted boot, the OTPMK must be used, so blobs must be generated on the i.MX6.
Next, this requires the device be in the Closed configuration, so the Mfg Tool U-boot and OS Kernel
images must be signed - in order to use the OTP Master Key. Today we do not have recommendations
and tools for customers how to perform it, sorry.
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------