CN112165396A - 一种安全固件更新的方法 - Google Patents

一种安全固件更新的方法 Download PDF

Info

Publication number
CN112165396A
CN112165396A CN202010957817.3A CN202010957817A CN112165396A CN 112165396 A CN112165396 A CN 112165396A CN 202010957817 A CN202010957817 A CN 202010957817A CN 112165396 A CN112165396 A CN 112165396A
Authority
CN
China
Prior art keywords
data
key
firmware
download
chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010957817.3A
Other languages
English (en)
Inventor
薛万树
杨念东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing CEC Huada Electronic Design Co Ltd
Original Assignee
Beijing CEC Huada Electronic Design Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing CEC Huada Electronic Design Co Ltd filed Critical Beijing CEC Huada Electronic Design Co Ltd
Priority to CN202010957817.3A priority Critical patent/CN112165396A/zh
Publication of CN112165396A publication Critical patent/CN112165396A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Abstract

在智能卡/MCU等安全芯片设计中,国密算法/指纹算法等固化的软件函数,是固件的常见形式,称为安全固件。安全固件多以HEX形式预存储在芯片专用NVM(Non‑Volatile Memory)区域,其更新下载的合法对象只能是算法提供方授权的合法固件数据,所以下载更新的过程需要解决数据泄露、数据篡改、数据完整性破坏等安全风险。本专利提出一种安全的固件更新方法,设计了一套预下载、密文保护以及身份验证机制,解决上述的安全风险,既可以鉴别目标下载数据的身份合法性,又可以保证目标下载数据的保密性/完整性,支持把安全固件的下载更新环节让渡到芯片普通用户的生产环节或者固件的在线升级环节。

Description

一种安全固件更新的方法
技术领域
本发明涉及一种安全固件更新的方法,适用于安全芯片设计领域中的安全固件更新下载。
背景技术
在智能卡/MCU等安全芯片设计中,国密算法/指纹算法等固化的软件函数,是固件的常见形式,称为安全固件。安全固件多以HEX形式预存储在芯片专用NVM(Non-VolatileMemory)区域。
安全固件的下载更新,是指PC主机/主控芯片等设备与目标安全芯片之间,通过约定的通信接口,将目标固件数据传输到安全芯片,由安全芯片的Loader负责完成安全固件的下载更新的过程。
安全固件往往是系统安全的逻辑基点,其更新下载的合法对象只能是算法提供方授权的合法固件数据,下载更新过程需要解决数据泄露、数据篡改、数据完整性破坏等安全风险。
其中,
防止数据泄露需要保证通信链路上数据是密文形式,加密算法多采用对称算法,但静态对称算法密钥的安全性建立在密钥的保密性,往往不可靠。基于ECDH机制生成的动态对称算法密钥(会话密钥)的安全性较强。
数据篡改是指合法数据被篡改,例如植入恶意代码数据或旁路安全相关代码数据等。
数据完整性破坏是指由恶意攻击或者下载流程错误等导致的固件数据不完整。
发明内容
本发明提供了一种安全固件更新的方法。该方法包括:通过预下载机制过滤非法数据;通过密文保护机制保护目标数据内容;通过身份验证机制确认数据的身份合法性。其中:
预下载数据结构,过滤非法数据,只允许合法数据更新到芯片存储介质;
身份验证,即预存公钥哈希值方法,通过公钥算法的验签机制确认数据的身份合法性;
密文保护机制:动态会话密钥、预存传输密钥、动态分散密钥以保护目标数据内容。
本发明中的传输密钥和分散密钥,是指国际通用对称算法的密钥。
本发明中的身份验签算法和哈希算法,是指国际通用的公钥算法。下文描述的公钥/私钥/哈希值等与公钥算法本身的定义一致。
执行安全固件更新的芯片,在内部NVM区域(仅限Loader有访问权限的存储区,普通用户没有访问权限),预存传输密钥。传输密钥作为目标安全固件的下载数据的加解密根密钥,是对安全固件更新内容的第一级保护。
执行安全固件更新的芯片,在内部NVM区域(仅限Loader有访问权限的存储区,普通用户没有访问权限),预存验签公钥的哈希值。验签公钥是下述预下载数据中的一部分。
见图3。
预下载是指Loader将通信接口接收的应用数据存储在缓存区的过程,而不是向NVM真正执行下载更新操作。
预下载数据存储在缓存区,一般是指SRAM。
预下载数据或脚本由安全固件开发者提供。
预下载的数据包括两类,一类是分散密钥数据,一类是目标下载数据。
预下载的分散密钥数据,见图2中的201,包含:密文格式的分散密钥、明文分散密钥的哈希值、对分散密钥哈希值的签名值、验签公钥。
密文格式的分散密钥,是使用会话密钥对明文分散密钥进行对称算法加密的密文格式。
明文分散密钥的哈希值,是对分散密钥明文进行哈希运算的结果。
对分散密钥哈希值的签名值,是使用公钥算法体系的私钥对哈希值进行签名的结果。
验签公钥,是指公钥算法体系的公钥,与上述签名过程使用的私钥互相对应。
预下载的目标下载数据,见图2中的202,包含:密文格式的目标下载数据、明文目标下载数据的哈希值、对目标下载数据哈希值的签名值、验签公钥。
密文格式的目标下载数据,是使用传输密钥与分散密钥这两级密钥异或之后的结果作为密钥,对明文目标下载数据进行对称算法加密的数据。
明文目标下载数据的哈希值,是对明文目标下载数据进行哈希运算的结果。
对明文目标下载数据哈希值的签名值,是使用公钥算法体系的私钥对哈希值进行签名的结果。
验签公钥,是指公钥算法体系的公钥,与上述签名过程使用的私钥互相对应。
提交预下载数据,是指对将缓存区的目标下载数据,进行合法性验证,合法性验证通过则向NVM执行更新下载操作。合法性验证包括:验签公钥验证、签名值验签。
验签公钥验证,是指对预下载数据中的验签公钥计算哈希值,与芯片预存的验签公钥哈希值进行比对验证,一致则公钥验证通过,否则公钥验证失败。
签名值验签,是指使用验签公钥,对预下载数据中的哈希值、签名值执行公钥算法的验签运算,运算结果表示验签通过还是失败。
固件更新过程中,通信双方首先基于标准ECDH算法,协商生成动态会话密钥。会话密钥生成过程的交互数据是明文形式。
会话密钥生成后,通信双方交互的应用数据,全部是使用会话密钥进行对称算法加密的密文格式。通信数据发送方负责对称算法加密,通信数据接收方负责对称算法解密。
预下载分散密钥数据后,执行固件更新的安全芯片对数据进行验证,即使用验签公钥执行公钥验签运算,验签通过则表示分散密钥数据合法,不通过则表示分散密钥数据不合法。
分散密钥,是对预下载的目标下载数据进行对称算法加解密的二级密钥,是对安全固件更新内容的第二级保护。
安全固件数据或脚本的提供者负责加密,执行固件更新的安全芯片Loader负责解密。
提交预下载数据后,数据验证合法,则执行固件更新的安全芯片Loader把明文数据更新到目标NVM。
下载完成后,Loader使用CRC/HASH等校验算法执行目标下载数据的完整性校验。
附图说明
图1是一种用于安全固件更新的方法流程示意图。
图2是一种用于安全固件更新的预下载数据结构示意图。
图3是一种用于安全固件更新的方法总体示意图
具体实施方式
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。图3是本发明的一种安全固件更新的方法总体示意图。执行安全固件更新的芯片,在内部NVM区域预存传输密钥和验签公钥的哈希值,传输密钥作为目标安全固件的下载数据的加解密根密钥,是对安全固件更新内容的第一级保护。验签公钥是预下载数据中的一部分。预下载数据存储在缓存区,预下载的数据包括两类,分散密钥数据和目标下载数据。
本发明实施例的核心构思在于,定义预下载数据结构,如图2中的201和202如示,过滤非法数据,只允许合法数据更新到芯片存储介质;定义预存公钥哈希值方法,通过公钥算法的验签机制确认数据的身份合法性;定义动态会话密钥、预存传输密钥、动态分散密钥以保护目标数据内容。
预下载的目标数据块单位大小,可根据执行固件更新的安全芯片的SRAM规格灵活制定。
预下载数据中的验签公钥的哈希值,预存在执行固件更新的安全芯片的内部存储区,只有执行固件更新的Loader有访问权限。
如图1所示是本发明的一个流程示例。
步骤101中使用ECDH算法生成会话密钥,包括但不限于国密SM2/SEC ECC/NISTECC等标准密钥协商算法。
步骤102中,目标分散密钥数据下载到缓存区待验证。
步骤103/104/105中,实施预下载分散密钥数据的验证和结果处理。
步骤107中,目标下载数据数据下载到缓存区待验证。
步骤108/109/110/111中,实施预下载目标下载数据的验证和结果处理。
如果目标下载数据块不止1块,则循环多次执行步骤107~111。
步骤112中,对已下载的目标下载数据进行完整性校验。

Claims (4)

1.一种安全固件更新的方法,其特征在于,包括:预下载机制、密文保护机制、身份验证机制;
所述的预下载机制,预下载的密钥长度,预下载的目标下载数据大小,可以根据实际芯片规格的不同存在多种不同规格;
所述的密文保护机制,包括会话密钥、传输密钥和分散密钥;
所述的身份验证机制,包括公钥验证和公钥验签。
2.根据权利要求1所述的预下载机制,其特征在于,非法的目标下载数据只能在缓存区暂存,缓存区内容在芯片掉电或复位后丢失,合法的目标下载数据才会真正更新到芯片NVM存储区。
3.根据权利要求1所述的密文保护机制,其特征在于,使用国际通用的对称算法的传输密钥和分散密钥二阶保护目标下载数据的内容。
4.根据权利要求1所述的身份验证机制,其特征在于,芯片预存公钥哈希值,并使用国际通用公钥算法的验签机制,确认预下载的数据的身份合法性。
CN202010957817.3A 2020-09-14 2020-09-14 一种安全固件更新的方法 Pending CN112165396A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010957817.3A CN112165396A (zh) 2020-09-14 2020-09-14 一种安全固件更新的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010957817.3A CN112165396A (zh) 2020-09-14 2020-09-14 一种安全固件更新的方法

Publications (1)

Publication Number Publication Date
CN112165396A true CN112165396A (zh) 2021-01-01

Family

ID=73858074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010957817.3A Pending CN112165396A (zh) 2020-09-14 2020-09-14 一种安全固件更新的方法

Country Status (1)

Country Link
CN (1) CN112165396A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116090031A (zh) * 2023-03-08 2023-05-09 上海泰矽微电子有限公司 一种基于芯片uuid的固件加密方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227503A (zh) * 2016-07-29 2016-12-14 苏州国芯科技有限公司 安全芯片cos固件更新方法、服务端、终端及系统
US20170272945A1 (en) * 2016-03-17 2017-09-21 M2MD Technologies, Inc. Method and system for managing security keys for user and M2M devices in a wireless communication network environment
CN109445705A (zh) * 2018-10-29 2019-03-08 湖南国科微电子股份有限公司 固件认证方法及固态硬盘
US20190342096A1 (en) * 2016-02-11 2019-11-07 Evident ID, Inc. Online identity and credential verification systems and methods protecting user data
CN110580420A (zh) * 2018-06-11 2019-12-17 阿里巴巴集团控股有限公司 基于集成芯片的数据处理方法、计算机设备、存储介质
CN110677250A (zh) * 2018-07-02 2020-01-10 阿里巴巴集团控股有限公司 密钥和证书分发方法、身份信息处理方法、设备、介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190342096A1 (en) * 2016-02-11 2019-11-07 Evident ID, Inc. Online identity and credential verification systems and methods protecting user data
US20170272945A1 (en) * 2016-03-17 2017-09-21 M2MD Technologies, Inc. Method and system for managing security keys for user and M2M devices in a wireless communication network environment
CN106227503A (zh) * 2016-07-29 2016-12-14 苏州国芯科技有限公司 安全芯片cos固件更新方法、服务端、终端及系统
CN110580420A (zh) * 2018-06-11 2019-12-17 阿里巴巴集团控股有限公司 基于集成芯片的数据处理方法、计算机设备、存储介质
CN110677250A (zh) * 2018-07-02 2020-01-10 阿里巴巴集团控股有限公司 密钥和证书分发方法、身份信息处理方法、设备、介质
CN109445705A (zh) * 2018-10-29 2019-03-08 湖南国科微电子股份有限公司 固件认证方法及固态硬盘

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
徐学东等: "基于国密算法的文件安全系统研究与实现", 《电子测试》 *
徐睿等: "基于国密算法和PUF的企业用户身份认证系统", 《计算机与现代化》 *
戴计生等: "嵌入式控制软件保密性设计研究与应用", 《机车电传动》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116090031A (zh) * 2023-03-08 2023-05-09 上海泰矽微电子有限公司 一种基于芯片uuid的固件加密方法

Similar Documents

Publication Publication Date Title
JP4668619B2 (ja) 装置鍵
US20190182051A1 (en) Systems and methods for trusted path secure communication
CN102725737B (zh) 可验证防泄漏的加密和解密
US9325496B2 (en) Encryption key providing method, semiconductor integrated circuit, and encryption key management device
US7370211B2 (en) Arrangement and method of execution of code
US7502941B2 (en) Wireless data communication method and apparatus for software download system
KR100670005B1 (ko) 모바일 플랫폼을 위한 메모리의 무결성을 원격으로 확인하는 확인장치 및 그 시스템 그리고 무결성 확인 방법
CN101145906B (zh) 对单向网络中的接收终端进行合法性认证的方法及系统
CN110519309B (zh) 数据传输方法、装置、终端、服务器及存储介质
CN110401615B (zh) 一种身份认证方法、装置、设备、系统及可读存储介质
US20050076226A1 (en) Computing device that securely runs authorized software
US20090249492A1 (en) Fabrication of computer executable program files from source code
CN110990827A (zh) 一种身份信息验证方法、服务器及存储介质
CN109412812B (zh) 数据安全处理系统、方法、装置和存储介质
CN108737442A (zh) 一种加密校验处理方法
CN105072125B (zh) 一种http通信系统及方法
CN101682628A (zh) 安全通信
CN108418691A (zh) 基于sgx的动态网络身份认证方法
JP2010200381A (ja) データ完全性を確認するための方法およびシステム
JP6387908B2 (ja) 認証システム
US9003197B2 (en) Methods, apparatus and system for authenticating a programmable hardware device and for authenticating commands received in the programmable hardware device from a secure processor
KR20070059891A (ko) 어플리케이션 인증 보안 시스템 및 그 인증 보안 방법
CN112165396A (zh) 一种安全固件更新的方法
KR20130100032A (ko) 코드 서명 기법을 이용한 스마트폰 어플리케이션 배포 방법
CN114329522A (zh) 一种私钥保护方法、装置、系统及存储介质

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210101

WD01 Invention patent application deemed withdrawn after publication