Hello,
I’m using a Jetson Orin NX and my goal is to have an encrypted rootfs NVMe drive to block disk access as described in the documentation.
But I would like to be able to decrypt the disk with another host to access the stored data in the case there would be a hardware failure.
For the encryption part, I got everything to work, my board is unfused and I flashed it with some customs keys and the board successfully booted on the encrypted partition.
But it is for the decryption part that I have some problems.
As I have the keys that got used to generate the encrypted rootfs, I thought it should be possible but I couldn’t get it to work.
Here is what I did:
# Use custom sym2_t234.key to generate a bootloader image and copy it to the correct folder
python3 gen_ekb.py -chip t234 -oem_k1_key oem_k1.key \
-in_sym_key2 sym2_t234.key -out eks_t234.img
cp ./source/tegra/optee-src/nv-optee/optee/samples/hwkey-agent/host/tool/gen_ekb/eks_t234.img ./bootloader/eks_t234.img
# With the board in recovery mode
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs \
-p "-c bootloader/generic/cfg/flash_t234_qspi.xml" --no-flash \
PE1100N-orin internal | tee internal_flashing_logs.txt
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --showlogs --network usb0 --no-flash \
--external-only --append -i ./sym2_t234.key PE1100N-orin external | tee external_flashing_logs.txt
# Finally flash both images on the device
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --showlogs --flash-only
As said previously, this part is working and the board is booting correctly after that.
But when using an external USB enclosure to connect the NVMe drive to a Ubuntu host, I can NOT get the partition to decrypt:
# Here is how I generated the passphrase based on the key and the board ID
python3 gen_luks_passphrase.py -k sym2_t234.key \
-c "luks-srv-ecid" -u -e "0x80012344705DE3C08C00000009FD8140"
# Trying to decrypt the drive gives this error
sudo cryptsetup open /dev/sda2 test_decrypt --key-file ./sym2_t234.key
No key available with this passphrase.
Am I doing something wrong or is it not possible ?
The log files are attached for more information if needed.
external_flashing_logs.txt (158.3 KB)
internal_flashing_logs.txt (210.6 KB)
serial_logs_boot.txt (104.7 KB)
Thanks for your help