1 Reason for enabling HAB encryption function 为什么要开启HAB加密功能

  NXP-MCUBootUtility is a tool designed for NXP MCU secure encryption boot. It fully supports secure encryption boot functions (signature only, signature and encryption) based on HAB implementation. HAB related functions are based on NXP's official HAB enablement tools. Due to the restriction of export control on security product, HAB Code Signing Tool cannot be directly integrated into NXP-MCUBootUtility installation package, so if you want to enbale HAB signature and encryption function for NXP-MCUBootUtility, You need to add HAB Code Signing Tool into NXP-MCUBootUtility manually. This article teaches you how to add HAB Code Signing Tool into NXP-MCUBootUtility to activate HAB encryption function.

  NXP-MCUBootUtility是一个专为NXP MCU安全加密启动而设计的工具,其能完整支持基于HAB实现的安全加密启动(单签名,签名和加密),而HAB相关的功能是借助恩智浦官方的HAB Code Signing Tool工具来实现的,HAB Code Signing Tool跟安全加密有关,因为一些跟欧美出口管制有关的原因,NXP-MCUBootUtility不能够直接将HAB Code Signing Tool工具集成到软件安装包里,所以如果要在NXP-MCUBootUtility里开启HAB签名和加密功能,需要自己将HAB Code Signing Tool工具添加到NXP-MCUBootUtility里,本篇文章即教大家如何添加HAB Code Signing Tool工具进NXP-MCUBootUtility以激活HAB加密功能。

2 Enable HAB signature function first 首先开启HAB签名功能

  First, you need to refer to 《开启NXP-MCUBootUtility工具的HAB签名功能 - CST》, This article teaches you to add the CST tool into NXP-MCUBootUtility and activates the HAB signature function, the prerequisite for activating HAB encryption function is to enable HAB signature function.

  首先参照 《开启NXP-MCUBootUtility工具的HAB签名功能 - CST》 这篇文章教你将CST工具添加进NXP-MCUBootUtility里并激活HAB签名功能,激活HAB加密的前提是使能HAB签名。

3 Regenerate cst.exe with AES encryption function 重新生成含AES加密功能的cst.exe

  The signature and encryption functions of NXP-MCUBootUtility are implemented by calling \NXP-MCUBootUtility\tools\cst\mingw32\bin\cst.exe. The cs.exe in the CST package downloaded from NXP's official website does not include AES encryption function by default. So we need to recompile and generate cst.exe with AES encryption function.

  NXP-MCUBootUtility的签名和加密功能均是通过调用\NXP-MCUBootUtility\tools\cst\mingw32\bin\cst.exe实现的,从恩智浦官网下载的CST包里的cst.exe默认没有开启AES加密功能,因此我们需要重新编译生成含AES加密功能的cst.exe。

3.1 Install gcc under MSYS2 在MSYS2下安装gcc

  First, you need to download the msys2 installation package on the website http://www.msys2.org/ and select the appropriate installation package according to your system (x86_64 is for 64bit system, i686 is for 32bit systems), We choose msys2-x86_64-20180531.exe here. After the installation is complete, open the MSYS2 MSYS console from the Start menu.

  首先在网站 http://www.msys2.org/ 下载msys2的安装包,根据你的系统选择合适的安装包(x86_64适用于64bit系统,i686适用于32bit系统),这里选择的是msys2-x86_64-20180531.exe,安装完成后从开始菜单里打开MSYS2 MSYS控制台。

  Execute the following four commands in sequence, and just input y when encountering ":: Proceed with installation? [Y/n]" questions. Note that you may need to close the console and reopen after the first command is executed. After successful execution of all commands, the basic configuration of MSYS2 and the installation of standard packages and gcc for compilation are completed.

  依次执行如下四条命令,遇到":: Proceed with installation? [Y/n]"询问全部输入y,注意第一条命令执行后可能需要关闭控制台重新打开。所有命令正常执行结束后便完成了MSYS2的基础更新配置以及用于编译的标准包和gcc的安装。

jay@pc MSYS ~
$ pacman -Syu
$ pacman -Su
$ pacman -S –-needed base-devel
$ pacman -S mingw-w64-i686-gcc

3.2 Compile openssl under MinGW 在MinGW下编译openssl

  Then download the openssl source package on the website https://www.openssl.org/, it is recommended to select the 1.0.x version (1.1.x version seems to have issues). We choose openssl-1.0.2q.tar.gz here. After downloading, decompress it and place it in the \NXP-MCUBootUtility\tools\openssl directory. Open the MSYS2 MinGW 32-bit console from the Start menu.

  然后在网站 https://www.openssl.org/ 下载openssl的源码包,推荐选择1.0.x版本(1.1.x版本经测试有问题),这里选择的是openssl-1.0.2q.tar.gz,下载完成后将其解压放置到\NXP-MCUBootUtility\tools\openssl\目录下,从开始菜单里打开MSYS2 MinGW 32-bit控制台。

  Use the cd command to checkout to the \NXP-MCUBootUtility\tools\openssl\openssl-1.0.2q directory and execute the following three commands in sequence. Note that the second command takes a little longer time (about 10 minutes). Please be patient.

  使用cd命令切换到\NXP-MCUBootUtility\tools\openssl\openssl-1.0.2q目录下,依次执行如下三条命令,注意第二条命令执行时间稍长(大约10分钟),请耐心等待。

jay@pc MINGW32 /d/NXP-MCUBootUtility/tools/openssl/openssl-1.0.2q
$ ./config
$ make
$ cp ms/applink.c include/openssl/

3.3 Generate cst.exe under MinGW 在MinGW下生成cst.exe

  Use the cd command to checkout to the \NXP-MCUBootUtility\tools\cst\code\back_end\src directory and execute the following two commands in sequence.

  继续在MSYS2 MinGW 32-bit控制台下操作,使用cd命令切换到\NXP-MCUBootUtility\tools\cst\code\back_end\src目录下,依次执行如下两条命令。

jay@pc MINGW32 /d/NXP-MCUBootUtility/tools/cst/code/back_end/src
$ gcc *.c -o cst.exe -I ../hdr -I ../../../../openssl/openssl-1.0.2q/include/ -L ../../../mingw32/lib/ -L ../../../../openssl/openssl-1.0.2q -lfrontend -lcrypto -lgdi32 -static
$ cp cst.exe ../../../mingw32/bin/

  At this point, the HAB encryption function is also activated. Open the NXP-MCUBootUtility and select the "HAB Encrypted Image Boot" mode in the Secure Boot Type and then enjoy it.

  至此NXP-MCUBootUtility的HAB加密功能也被激活了,打开NXP-MCUBootUtility软件,在Secure Boot Type里选择"HAB Encrypted Image Boot"模式试试吧。

痞子衡嵌入式:开启NXP-MCUBootUtility工具的HAB加密功能 - CST(中英双语)的更多相关文章

  1. 痞子衡嵌入式:开启NXP-MCUBootUtility工具的HAB签名功能 - CST(中英双语)

    1 Reason for enabling HAB signature function 为什么要开启HAB签名功能 NXP-MCUBootUtility is a tool designed for ...

  2. 痞子衡嵌入式:恩智浦MCU安全加密启动一站式工具NXP-MCUBootUtility用户指南

    NXP MCU Boot Utility English | 中文 1 软件概览 1.1 介绍 NXP-MCUBootUtility是一个专为NXP MCU安全加密启动而设计的工具,其特性与NXP M ...

  3. 痞子衡嵌入式:飞思卡尔i.MX RT系列MCU开发那些事 - 索引

    大家好,我是痞子衡,是正经搞技术的痞子.本系列痞子衡给大家介绍的是飞思卡尔i.MX RT系列微控制器相关知识. 飞思卡尔半导体(现恩智浦半导体)于2017年开始推出的i.MX RT系列开启了高性能MC ...

  4. 痞子衡嵌入式:MCUBootUtility v2.4发布,轻松更换Flashloader文件

    -- 痞子衡维护的NXP-MCUBootUtility工具距离上一个版本(v2.3.1)发布过去2个月了,这一次痞子衡为大家带来了版本升级v2.4.0,这个版本主要有一个非常重要的更新需要跟大家特别说 ...

  5. 痞子衡嵌入式:MCUBootUtility v3.0发布,开始支持LPC, Kinetis啦

    -- 痞子衡维护的NXP-MCUBootUtility工具距离上一个版本(v2.4.0)发布过去2个半月了,这一次痞子衡为大家带来了全新版本v3.0.0,从这个版本开始,NXP-MCUBootUtil ...

  6. 痞子衡嵌入式:MCUBootUtility v2.3发布,这次不再放过任何一款Flash

    -- 痞子衡的 NXP-MCUBootUtility 开源项目自2018年8月27日第一笔提交至今已有21个月,目前累计代码已近50000行.相信这个工具为大家开发 i.MXRT 项目提供了一些便利, ...

  7. 痞子衡嵌入式:恩智浦i.MX RT1xxx系列MCU硬件那些事(2.3)- 串行NOR Flash下载算法(J-Link工具篇)

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是J-Link工具下i.MXRT的串行NOR Flash下载算法设计. 在i.MXRT硬件那些事系列之<在串行NOR Flash X ...

  8. 痞子衡嵌入式:恩智浦i.MX RT1xxx系列MCU硬件那些事(2.4)- 串行NOR Flash下载算法(Keil MDK工具篇)

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是Keil MDK工具下i.MXRT的串行NOR Flash下载算法设计. 在i.MXRT硬件那些事系列之<在串行NOR Flash ...

  9. 痞子衡嵌入式:在IAR开发环境下为工程开启CRC完整性校验功能的方法

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家分享的是在IAR开发环境下为工程开启CRC完整性校验功能的方法. CRC校验在嵌入式领域里的应用非常广,比如在通信领域,CRC检验值可以作为数据 ...

随机推荐

  1. monkey----log分析要求

    对monkey测试过程中生成的XXX.log文件中进行关键字的查找.主要查找讯息如下: (1) anr项:即无响应,一般形式为ANR in org.codeaurora.bluetooth: (2)c ...

  2. mysql 使用Navicat Lite如何打开‘查询编辑器’,使用sql语句对表进行操作!

    今天第一次使用mysql,尽然连查询编辑器都找不到,研究了半天,询问了下大牛,才搞出来,准备写下来,后面方面忘记了有查找的地方,哈哈哈~~ 如何打开"查询编辑器",使用sql语句进 ...

  3. 若干排序算法的Python实现方法及原理

    今天突然想到了一个问题:让你立即把堆排.快排等等排序算法写出来会不会,并且不能犯逻辑错误? 我说:不会,至少需要思考一下,并且可能还需要时间调试. 之前总是觉得,不就是排序算法吗?有什么大不了的?网上 ...

  4. hydra暴力破解ssh服务器密码

    概述 我都没想到,第一次暴力破解服务器密码.竟然是对自己的单位服务器出手..囧,因为还没来得及找测试部要来服务器登录密码,测试部负责人已经下班走了.后来又联系不上,这要更新代码,怎么办..于是就对测试 ...

  5. 【工具篇】抓包中的王牌工具—Fiddler (1-环境搭建)

    导言 在现在高速发展的互联网时代,抓包工具被广泛应用在软件开发的项目中,Fiddler可谓是当下主流的抓包工具之一.测试人员用它来抓包.回放测试记录,构造发包测试用例,开发人员用来定位问题,其强大的功 ...

  6. 【重学计算机】操作系统D5章:文件系统

    1. 文件系统 文件系统概述 文件的组织: 逻辑结构:流式.记录式 物理结构:顺序.连接.直接.索引 文件的存取:顺序.直接.索引 文件的控制:逻辑控制.物理控制 文件的使用:打开.关闭.读.写.控制 ...

  7. 『简单积性函数和dirichlet卷积』

    简单积性函数 在学习欧拉函数的时候,相信读者对积性函数的概念已经有了一定的了解.接下来,我们将相信介绍几种简单的积性函数,以备\(dirichlet\)卷积的运用. 定义 数论函数:在数论上,对于定义 ...

  8. 强化学习(十四) Actor-Critic

    在强化学习(十三) 策略梯度(Policy Gradient)中,我们讲到了基于策略(Policy Based)的强化学习方法的基本思路,并讨论了蒙特卡罗策略梯度reinforce算法.但是由于该算法 ...

  9. 金三银四,如何征服面试官,拿到Offer

    又到了茶余饭后的时间,想想写点什么,掐指一算,噢呦,快到3月份了,职场的金三银四跳槽季又来了,不同的是今年比往年「冷」一些,形式更加严峻一些,大家多多少少可能都听到或看到一些信息,就是好多公司在优化裁 ...

  10. 欢迎使用IdentityModel文档!- IdentityModel 中文文档(v1.0.0)

    IdentityModel是基于声明的身份,OAuth 2.0和OpenID Connect的.NET标准帮助程序库. 它具有以下高级功能: 标准OAuth 2.0和OpenID Connect端点的 ...