CN112069547B - Identity authentication method and system for supply chain responsibility main body - Google Patents

Identity authentication method and system for supply chain responsibility main body Download PDF

Info

Publication number
CN112069547B
CN112069547B CN202010743844.0A CN202010743844A CN112069547B CN 112069547 B CN112069547 B CN 112069547B CN 202010743844 A CN202010743844 A CN 202010743844A CN 112069547 B CN112069547 B CN 112069547B
Authority
CN
China
Prior art keywords
private key
signature
group
calculate
user
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.)
Active
Application number
CN202010743844.0A
Other languages
Chinese (zh)
Other versions
CN112069547A (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 Research Center for Information Technology in Agriculture
Original Assignee
Beijing Research Center for Information Technology in Agriculture
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 Research Center for Information Technology in Agriculture filed Critical Beijing Research Center for Information Technology in Agriculture
Priority to CN202010743844.0A priority Critical patent/CN112069547B/en
Publication of CN112069547A publication Critical patent/CN112069547A/en
Application granted granted Critical
Publication of CN112069547B publication Critical patent/CN112069547B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a method and a system for authenticating identity of a supply chain responsibility main body, comprising the following steps: generating a public-private key pair of the responsibility main body according to the identity of the responsibility main body and the user password, wherein the public-private key pair comprises a system main private key and a system main public key; generating a signature private key according to the system main private key and the user identifier; carrying out digital signature encryption on the user data of the responsible main body by using a signature private key to obtain signature data; and verifying the signature data by using the identity. According to the identity authentication method and system for the supply chain responsibility main body, provided by the embodiment of the invention, the user-set password is added when the system main private key and the signature private key are generated, and the signature is performed after double verification of the user identifier and the user password is needed when the signature is used, so that the safety of the main private key and the signature private key is improved, and the problems of inaccurate verification or user data leakage can be effectively prevented.

Description

一种供应链责任主体身份认证方法及系统A supply chain responsible subject identity authentication method and system

技术领域Technical field

本发明涉及区块链技术领域,尤其涉及一种供应链责任主体身份认证方法及系统。The present invention relates to the field of blockchain technology, and in particular to a supply chain responsible subject identity authentication method and system.

背景技术Background technique

农产品信息化追溯系统中身份信息是分散在各个系统中,每个系统都需要用户填写身份信息进行登记和实名认证(know-your-customer,简称KYC认证),而系统需要设定专人对登记信息进行审核和确认,既浪费用户的时间,也消耗所在平台的人力、财力和物力。随着区块链业务的发展,需要建立一种安全的数字身份认证体系,让用户在区块链不同的分布式应用中,使用自己的数字身份。In the agricultural product information traceability system, identity information is scattered in various systems. Each system requires users to fill in identity information for registration and real-name authentication (know-your-customer, referred to as KYC authentication), and the system needs to set up a dedicated person to verify the registration information. Reviewing and confirming not only wastes the user's time, but also consumes the human, financial and material resources of the platform. With the development of blockchain business, it is necessary to establish a secure digital identity authentication system to allow users to use their digital identities in different distributed applications of blockchain.

数字身份(Digital identity,简称DI)也称数字标识,是可唯一确定一个实体身份的信息。数字身份应由实体无法否认的信息组成,如实体的可识别名称、电子邮箱、身份证号、电话号码等。数字身份也是真实身份信息通过数字标识的代码表示,负责连接物理世界的实体对象和数字世界的对象。下一代互联网是全面数字化的时代,现实世界的组织、企业、个人,还有各种商品,甚至各种设备物体等需要在数字环境中具备代表自己在数字世界中的身份。Digital identity (DI), also known as digital identification, is information that can uniquely determine the identity of an entity. The digital identity should consist of information that the entity cannot deny, such as the entity’s identifiable name, email address, ID number, phone number, etc. Digital identity is also a code representation of real identity information through a digital identity, responsible for connecting physical objects in the physical world and objects in the digital world. The next generation Internet is an era of comprehensive digitalization. Real-world organizations, enterprises, individuals, various commodities, and even various equipment objects need to have identities that represent themselves in the digital world in the digital environment.

数字身份可以使用标识代码,比如组织代码、企业统一信用代码、个人身份证号码、手机号码、email地址、商品条码、各类编码等来表示。随着区块链时代的到来,使用统一的数字身份成为区块链世界数据共享和交换的基础。Digital identity can be represented by identification codes, such as organization codes, enterprise unified credit codes, personal ID numbers, mobile phone numbers, email addresses, product barcodes, various codes, etc. With the advent of the blockchain era, the use of unified digital identities has become the basis for data sharing and exchange in the blockchain world.

但目前关于农产品供应链主体身份认证时,存在农产品供应链节点的访问者的物理身份和数字身份的不一致性问题,无法有效的追溯责任主体的真实性和信息传递的有效性。However, when it comes to identity authentication of agricultural product supply chain subjects, there is an inconsistency problem between the physical identity and digital identity of visitors to agricultural product supply chain nodes, making it impossible to effectively trace the authenticity of the responsible subject and the effectiveness of information transmission.

发明内容Contents of the invention

本发明实施例提供一种供应链责任主体身份认证方法及系统,用以解决现有技术中用户数据安全性、保密性不强的缺陷,实现在增强用户数据安全防护的基础上,合理、高效、安全的对供应链责任主体身份认证的方法。Embodiments of the present invention provide a supply chain responsible subject identity authentication method and system to solve the shortcomings of user data security and confidentiality in the existing technology, and achieve reasonable and efficient performance on the basis of enhancing user data security protection. , a safe method to authenticate the identity of supply chain responsible entities.

第一方面,本发明实施例提供一种供应链责任主体身份认证方法,主要包括:根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;根据系统主私钥和用户标识生成签名私钥;利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;利用身份标识对签名数据进行验证。In the first aspect, embodiments of the present invention provide a supply chain responsible subject identity authentication method, which mainly includes: generating a public-private key pair of the responsible subject according to the identity identifier and user password of the responsible subject, and a public-private key pair. Including the system master private key and the system master public key; generate a signature private key based on the system master private key and user identification; use the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain the signature data; use the identity identifier to perform signature data verify.

作为可选地,上述根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对,主要包括:利用密钥生成中心,对责任主体的身份标识和用户密码进行一次哈希加密,生成公-私密钥对,并将系统主公钥发布至区块链进行公开。As an option, the above-mentioned generation of the public-private key pair of the responsible subject based on the identity of the responsible subject and the user password mainly includes: using the key generation center to perform a hash encryption on the identity of the responsible subject and the user password, Generate a public-private key pair and publish the system master public key to the blockchain for public disclosure.

作为可选地,上述根据系统主私钥和用户标识生成签名私钥,主要包括:利用密钥生成中心,对系统主私钥和用户标识进行二次哈希加密,生成签名私钥。Optionally, the above method of generating a signature private key based on the system master private key and user identification mainly includes: using a key generation center to perform secondary hash encryption on the system master private key and user identification to generate a signature private key.

作为可选地,上述利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据,包括:Optionally, the above-mentioned method uses the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain the signature data, including:

S31,计算关于用户数据的群GT中的元素g,g=e(P1,Ppub-8);元素g表示中间加密结果;e表示从群G1×G2到群GT的双线性对,G1和G2表示加法循环群,GT为乘法循环群,群G1、G2和GT有相同的阶数;P1表示群G1的生成元,Ppub-8表示系统主私钥;S31, calculate the element g in the group G T about the user data, g=e(P 1 ,P pub-8 ); the element g represents the intermediate encryption result; e represents the double from the group G 1 × G 2 to the group G T Linear pair, G 1 and G 2 represent the additive cyclic group, G T is the multiplicative cyclic group, the groups G 1 , G 2 and G T have the same order; P 1 represents the generator of the group G 1 , P pub-8 Represents the system master private key;

S32,产生随机数r,r∈[1,N-1];r表示在预定范围内所选取的随机数,N表示群G1、G2和GT的阶数;S32, generate a random number r, r∈[1,N-1]; r represents a random number selected within a predetermined range, and N represents the order of groups G 1 , G 2 and G T ;

S33,计算群GT中的元素w,w=gr,将w的数据类型转换为比特串;w表示密文的组成部分;S33, calculate the element w in the group G T , w= gr , and convert the data type of w into a bit string; w represents the component of the ciphertext;

S34,计算证书h,h=H2(M||w,N);h表示证书,H2()表示安全的杂凑函数,M表示与用户数据对应的比特串,符号||表示关联运算关系;S34, calculate the certificate h, h=H 2 (M||w, N); h represents the certificate, H 2 () represents the secure hash function, M represents the bit string corresponding to the user data, and the symbol || represents the associated operation relationship ;

S35,计算证书l,l=(r-h)mod N;若l=0则返回步骤S32;若l≠0,则进入步骤S36;S35, calculate the certificate l, l=(r-h)mod N; if l=0, return to step S32; if l≠0, enter step S36;

S36,计算群G1中的元素S,S=[l]dsA;dsA表示签名私钥,[l]dsA表示将l与dsA进行点乘运算;S36, calculate the element S in the group G 1 , S=[l]ds A ; ds A represents the signature private key, [l]ds A represents the dot multiplication operation of l and ds A ;

S37,获取所述签名数据K,K=(h,S)。S37: Obtain the signature data K, K=(h, S).

作为可选地,上述利用身份标识对签名数据进行验证,主要包括:As an option, the above-mentioned verification of signature data using identity identifiers mainly includes:

设待验证签名数据表示为K’,K’=(h’,S’),与待验证用户数据对应的比特串表示为M’;Assume that the signature data to be verified is represented by K’, K’=(h’, S’), and the bit string corresponding to the user data to be verified is represented by M’;

S41,检验h′∈[1,N-1]是否成立;若不成立,则验证不通过;若成立,则执行步骤S42;S41, check whether h′∈[1,N-1] is established; if it is not established, the verification fails; if it is established, step S42 is executed;

S42,将S′的数据类型转换成椭圆曲线上的点,检验S′∈G1是否成立;若不成立,则验证不通过;若成立,则执行步骤S43;S42, convert the data type of S' into a point on the elliptic curve, and check whether S'∈G 1 is established; if not, the verification fails; if it is established, step S43 is executed;

S43,计算群GT中的元素g,g=e(P1,P’pub-8);P’pub-8表示系统主公钥;S43, calculate the element g in the group G T , g=e(P 1 ,P' pub-8 ); P' pub-8 represents the system master public key;

S44,计算群GT中的元素t,t=ghS44, calculate the element t in the group G T , t=g h ;

S45,计算证书h1,h1=H1(IDA||hid,N);IDA表示用户的身份标识,hid表示证书id;H1()表示安全的杂凑函数;S45, calculate certificate h 1 , h 1 =H 1 (ID A ||hid,N); ID A represents the user's identity, hid represents the certificate id; H 1 () represents a secure hash function;

S46,计算群G2中的元素P,P=[h1]P2+P’pub-s;P2表示群G2的生成元,P’pub-s表示系统主公钥;S46, calculate the element P in the group G 2 , P=[h 1 ]P 2 +P'pub-s; P 2 represents the generator of the group G 2 , and P' pub-s represents the system master public key;

S47,计算群GT中的元素u,u=e(S′,P);S47, calculate the element u in the group G T , u=e(S′, P);

S48,计算群GT中的元素w’,w’=u·t,将w’的数据类型转化成比特串;u,t分别表示系统主私钥的组成部分;S48, calculate the element w' in the group G T , w'=u·t, and convert the data type of w' into a bit string; u and t respectively represent the components of the system's master private key;

S49,计算证书h2=H2(M’||w’,N),检验h2=h’是否成立;若成立,则验证通过;否则验证不通过。S49, calculate the certificate h 2 =H 2 (M'||w', N), and check whether h 2 =h' is established; if it is established, the verification passes; otherwise, the verification fails.

作为可选地,本发明实施例提供的供应链责任主体身份认证方法,还可以包括:基于国密SM9算法,以根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对并根据系统主私钥和用户标识生成签名私钥。Optionally, the supply chain responsible subject identity authentication method provided by the embodiment of the present invention may also include: based on the national secret SM9 algorithm to generate a public-private key pair of the responsible subject based on the identity of the responsible subject and the user password and Generate a signature private key based on the system master private key and user ID.

作为可选地,用户标识可以为:以包括企业名称、社会统一信用代码、地址、法人代表等信息的档案所构建的标识。Alternatively, the user identification may be an identification constructed from a file including company name, social unified credit code, address, legal representative and other information.

第二方面,本发明实施例还提供一种供应链责任主体身份认证系统,主要包括:公-私密钥生成单元、签名私钥生成单元、加密单元和验证单元,其中:公-私密钥生成单元主要用于根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;签名私钥生成单元主要用于根据系统主私钥和用户标识生成签名私钥;加密单元主要用于利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;验证单元主要用于利用身份标识对签名数据进行验证。In a second aspect, embodiments of the present invention also provide a supply chain responsible subject identity authentication system, which mainly includes: a public-private key generation unit, a signature private key generation unit, an encryption unit and a verification unit, wherein: the public-private key The generation unit is mainly used to generate the public-private key pair of the responsible subject based on the identity of the responsible subject and the user password. The public-private key pair includes the system master private key and the system master public key; the signature private key generation unit is mainly used to Generate a signature private key based on the system master private key and user identification; the encryption unit is mainly used to use the signature private key to digitally sign and encrypt the user data of the responsible subject, and obtain the signature data; the verification unit is mainly used to verify the signature data using the identity identification .

第三方面,本发明实施例还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述供应链责任主体身份认证方法的步骤。In a third aspect, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, any one of the above is implemented. The steps of the supply chain responsibility subject identity authentication method.

第四方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述供应链责任主体身份认证方法的步骤。In a fourth aspect, embodiments of the present invention also provide a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the identity authentication of the supply chain responsible subject is implemented as described above. Method steps.

本发明实施例提供的供应链责任主体身份认证方法及系统,在产生系统主私钥和签名私钥时加入了用户设定的密码,在使用签名时需要由用户标识、用户密码双重验证后进行签名,提升了主私钥和签名私钥的安全性,能有效防止验证不准确或者用户资料泄漏的问题发生。The supply chain responsible subject identity authentication method and system provided by the embodiments of the present invention add the password set by the user when generating the system master private key and signature private key. When using the signature, it needs to be double verified by the user ID and user password. Signature improves the security of the master private key and signature private key, and can effectively prevent inaccurate verification or leakage of user information.

附图说明Description of the drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1是本发明实施例提供的一种供应链责任主体身份认证方法的结构示意图;Figure 1 is a schematic structural diagram of a supply chain responsible subject identity authentication method provided by an embodiment of the present invention;

图2为本发明实施例提供的一种供应链责任主体身份认证系统的结流程示意图;Figure 2 is a schematic flow diagram of a supply chain responsible subject identity authentication system provided by an embodiment of the present invention;

图3是本发明实施例提供的一种电子设备的结构示意图。Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.

本发明实施例提供一种供应链责任主体身份认证方法,如图1所示,包括但不限于以下步骤:An embodiment of the present invention provides a supply chain responsible subject identity authentication method, as shown in Figure 1, including but not limited to the following steps:

步骤S1:根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,所述公-私密钥对包括系统主私钥和系统主公钥;Step S1: Generate a public-private key pair of the responsible subject based on the identity of the responsible subject and the user password. The public-private key pair includes the system master private key and the system master public key;

步骤S2:根据所述系统主私钥和用户标识生成签名私钥;Step S2: Generate a signature private key based on the system master private key and user identification;

步骤S3:利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;Step S3: Use the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain the signature data;

步骤S3:利用所述身份标识对签名数据进行验证。Step S3: Use the identity identifier to verify the signature data.

其中,步骤S1可视作对责任主体的身份标识利用用户密码,基于区块链技术进行一次加密的过程;其中,责任主体的身份标识可以是责任主体的手机号、身份证号、追溯编码、企业统一信用代码、emaill地址、商品条码等专属于责任主体的用于进行身份识别的信息。一般来说身份标识与这人主体是一一对应关系,即通过任一身份标识可以对应获知与之对应的责任主体。Among them, step S1 can be regarded as a process of encrypting the identity of the responsible subject using the user password based on blockchain technology; among them, the identity of the responsible subject can be the mobile phone number, ID number, traceability code, Enterprise unified credit code, email address, product barcode and other information exclusive to the responsible party for identification. Generally speaking, there is a one-to-one correspondence between the identity identifier and the person's subject, that is, the corresponding responsible subject can be known through any identity identifier.

其中,用于生成责任主体的公-私密钥对的区块链算法可以是采用基于国产SM2、SM3或SM9的标识密码方法,对此本发明实施例不作具体地限定。具体地,可以通过区块链的密钥生成中心(key generation center,简称KGC)来进行。KGC是一种负责选择系统参数、生成主密钥并产生用户私钥的可信机构系统,利用其进行数字身份生成时,系统主密钥是处于标识密码密钥分层结构最顶层的密钥,主要包括系统主私钥和系统主公钥,其中系统主公钥用于公开发布至区块链上,而系统主私钥则是由KGC加密后交于用户进行秘密保存。在标识密码中,系统主私钥是由KGC通过随机数发生器产生,而系统主公钥是由系统主私钥结合系统参数产生。The blockchain algorithm used to generate the public-private key pair of the responsible subject may be an identification cryptographic method based on domestic SM2, SM3 or SM9, which is not specifically limited in this embodiment of the present invention. Specifically, it can be carried out through the key generation center (KGC) of the blockchain. KGC is a trusted organization system responsible for selecting system parameters, generating master keys and generating user private keys. When using it to generate digital identities, the system master key is the key at the top of the identity cryptographic key hierarchy. , mainly includes the system master private key and the system master public key. The system master public key is used to publish to the blockchain publicly, while the system master private key is encrypted by KGC and handed over to the user for secret preservation. In the identification password, the system master private key is generated by KGC through a random number generator, and the system master public key is generated by the system master private key combined with system parameters.

需要说明的是:在产生系统主私钥时,添加用户密码,使用身份标识和密码产生系统主私钥和系统主公钥是一密一签,且随加密时间、次数而动态变化,保证了主私钥既有用户自己设定的属性,又提高了主私钥的安全性。It should be noted that when generating the system master private key, add the user password, use the identity identifier and password to generate the system master private key and the system master public key, which are one secret and one signature, and dynamically change with the encryption time and number of times, ensuring The master private key not only has attributes set by the user, but also improves the security of the master private key.

在步骤S2中,在生成公-私密钥对之后,本发明实施例所提供的供应链责任主体身份认证方法,进一步对系统主私钥进行二次加密,其加密的过程中,除了添加用户密码外,还可以进一步的将系统主私钥与用户标识相结合,以解决农产品供应链节点用户的物理身份和数字身份的不一致性问题,从而保证用户的物理身份与数字身份相对应。其中,用户标识是与每个用户唯一对应的标识信息,例如:指纹信息、瞳孔信息、签名信息、印章信息等等,对此本发明实施例不作具体地限定。在利用系统主私钥和用户标识产生签名私钥采用的是一密一签的方式,且是动态变化的,从而能够保证数字身份的真实可信。In step S2, after generating the public-private key pair, the supply chain responsible subject identity authentication method provided by the embodiment of the present invention further encrypts the system master private key twice. During the encryption process, in addition to adding the user In addition to the password, the system master private key can be further combined with the user identification to solve the inconsistency problem between the physical identity and the digital identity of the node user of the agricultural product supply chain, thereby ensuring that the user's physical identity corresponds to the digital identity. The user identification is identification information uniquely corresponding to each user, such as fingerprint information, pupil information, signature information, seal information, etc., which is not specifically limited in this embodiment of the present invention. When using the system's master private key and user identification to generate a signature private key, a one-key-one-sign method is used, and it changes dynamically, thus ensuring the authenticity and credibility of the digital identity.

步骤S3可视为利用上一步骤中构建的经过2次加密的私钥,即签名私钥对用户数据进行数字签名的步骤。由于这一步骤中所使用的签名私钥中同时包含有用户的密码、身份标识信息以及用户标识信息,在保证了数字签名与用户身份的一一对应的基础上,有效的增加了用户数据的安全性和私密性。Step S3 can be regarded as a step of digitally signing user data using the twice-encrypted private key constructed in the previous step, that is, the signature private key. Since the signature private key used in this step also contains the user's password, identity information, and user identification information, it effectively increases the security of user data while ensuring the one-to-one correspondence between the digital signature and the user's identity. Security and privacy.

步骤S4可以视为对加密后的用户数据进行验证的步骤。在验证的过程中,仅需要使用标识作为物联网世界中数字身份识别、数字签名、数字验证的依据,即可以实现对签名数据的验证,在保证验证准确性的前提下,简化了验证的步骤。Step S4 can be regarded as a step of verifying the encrypted user data. In the verification process, only the identification is needed as the basis for digital identity recognition, digital signature, and digital verification in the Internet of Things world, that is, the signature data can be verified, and the verification steps are simplified while ensuring the accuracy of the verification. .

本发明实施例提供的供应链责任主体身份认证方法,在产生系统主私钥和签名私钥时加入了用户设定的密码,在使用签名时需要由用户标识、用户密码双重验证后进行签名,提升了主私钥和签名私钥的安全性,能有效防止验证不准确或者用户资料泄漏的问题发生。The supply chain responsible subject identity authentication method provided by the embodiment of the present invention adds the password set by the user when generating the system master private key and signature private key. When using the signature, it is necessary to double-verify the user ID and user password before signing. The security of the master private key and signature private key has been improved, which can effectively prevent inaccurate verification or leakage of user information.

基于上述实施例的内容,作为一种可选实施例,所述根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,可以包括:利用密钥生成中心,对责任主体的身份标识和用户密码进行一次哈希加密,生成公-私密钥对,并将系统主公钥发布至区块链进行公开。Based on the contents of the above embodiments, as an optional embodiment, generating the public-private key pair of the responsible subject according to the identity of the responsible subject and the user password may include: using a key generation center to generate the key pair for the responsible subject. The subject's identity and user password are hashed and encrypted to generate a public-private key pair, and the system's master public key is published to the blockchain for disclosure.

具体地,整个步骤可以分为哈希和加密两个方面,其中哈希(Hash)是将目标文本(即与身份标识和用户密码对应的文本)转换成具有相同长度的、不可逆的杂凑字符串(或叫做消息摘要);而加密(Encrypt)则是将目标文本转换成具有不同长度的、且可逆的密文。其中,在本发明中的加密算法可以是基于国密SM2、SM3或SM9等,对此本发明实施例不作具体地限定。Specifically, the entire step can be divided into two aspects: hashing and encryption. Hash is to convert the target text (that is, the text corresponding to the identity identifier and user password) into an irreversible hash string of the same length. (or called message digest); and encryption (Encrypt) converts the target text into reversible ciphertext with different lengths. Among them, the encryption algorithm in the present invention may be based on the national secret SM2, SM3 or SM9, etc., which is not specifically limited in the embodiment of the present invention.

本发明实施例提供的供应链责任主体身份认证方法,在现有的基于国密SM2、SM3或SM9等进行责任主体加密的基础上,结合了用户密码,进一步地保证了用户数据的安全性。The supply chain responsible subject identity authentication method provided by the embodiment of the present invention is based on the existing responsible subject encryption based on national secrets SM2, SM3 or SM9, etc., and combines the user password to further ensure the security of user data.

基于上述实施例的内容,作为一种可选实施例,上述根据系统主私钥和用户标识生成签名私钥,可以包括:利用密钥生成中心,对系统主私钥和用户标识进行二次哈希加密,生成签名私钥。Based on the content of the above embodiments, as an optional embodiment, the above-mentioned generation of signature private keys based on the system master private key and user identification may include: using a key generation center to perform secondary hashing on the system master private key and user identification. Hash encryption to generate a signature private key.

具体地,在本发明实施例中通过KGC对系统主私钥进行二次加密,包括对上一步骤中获取的系统主私钥结合用户标识进行二次加密,使得二次加密后的签名私钥,不仅包含有用户设置的密码信息、用户的身份标识信息,关键是还包括了用户的标识信息,在为用户数据提供足够的安全性和保密性的基础上,有效的防止验证不准确或者用户资料泄漏的问题发生。Specifically, in the embodiment of the present invention, the system master private key is re-encrypted through KGC, which includes re-encrypting the system master private key obtained in the previous step combined with the user identification, so that the signature private key after the re-encryption is , not only includes the password information set by the user and the user's identity information, but also the user's identification information. On the basis of providing sufficient security and confidentiality for user data, it can effectively prevent inaccurate verification or user identification information. Data leakage occurs.

作为可选地,在二次加密的过程中,也可以再设置另一用户密码,通过采用多层密码保护,以进一步的加强数据的安全性。Optionally, during the secondary encryption process, another user password can also be set to further enhance data security by using multi-layer password protection.

基于上述实施例的内容,作为一种可选实施例,所述利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据,可以包括以下步骤:Based on the contents of the above embodiments, as an optional embodiment, using the signature private key to digitally sign and encrypt the user data of the responsible subject and obtain the signature data may include the following steps:

S31,计算关于用户数据的群GT中的元素g,g=e(P1,Ppub-8);元素g表示中间加密结果;e表示从群G1×G2到群GT的双线性对,G1和G2表示加法循环群,GT为乘法循环群,群G1、G2和GT有相同的阶数;P1表示群G1的生成元,Ppub-8表示系统主私钥;S31, calculate the element g in the group G T about the user data, g=e(P 1 ,P pub-8 ); the element g represents the intermediate encryption result; e represents the double from the group G 1 × G 2 to the group G T Linear pair, G 1 and G 2 represent the additive cyclic group, G T is the multiplicative cyclic group, the groups G 1 , G 2 and G T have the same order; P 1 represents the generator of the group G 1 , P pub-8 Represents the system master private key;

S32,产生随机数r,r∈[1,N-1];r表示在预定范围内所选取的随机数,N表示群G1、G2和GT的阶数;S32, generate a random number r, r∈[1,N-1]; r represents a random number selected within a predetermined range, and N represents the order of groups G 1 , G 2 and G T ;

S33,计算群GT中的元素w,w=gr,将w的数据类型转换为比特串;w表示密文的组成部分;S33, calculate the element w in the group G T , w= gr , and convert the data type of w into a bit string; w represents the component of the ciphertext;

S34,计算证书h,h=H2(M||w,N);h表示证书,H2()表示安全的杂凑函数,M表示与用户数据对应的比特串,符号||表示关联运算关系;S34, calculate the certificate h, h=H 2 (M||w, N); h represents the certificate, H 2 () represents the secure hash function, M represents the bit string corresponding to the user data, and the symbol || represents the associated operation relationship ;

S35,计算证书l,l=(r-h)mod N;若l=0则返回步骤S32;若l≠0,则进入步骤S36;S35, calculate the certificate l, l=(r-h)mod N; if l=0, return to step S32; if l≠0, enter step S36;

S36,计算群G1中的元素S,S=[l]dsA;dsA表示签名私钥,[l]dsA表示将l与dsA进行点乘运算;S36, calculate the element S in the group G 1 , S=[l]ds A ; ds A represents the signature private key, [l]ds A represents the dot multiplication operation of l and ds A ;

S37,获取所述签名数据K,K=(h,S)。S37: Obtain the signature data K, K=(h, S).

基于上述实施例的内容,作为一种可选实施例,上述利用所述身份标识对签名数据进行验证,可以包括以下步骤:Based on the contents of the above embodiments, as an optional embodiment, the above-mentioned verification of signature data using the identity identifier may include the following steps:

为表述方便,设待验证签名数据表示为K’,K’=(h’,S’),与待验证用户数据对应的比特串表示为M’;For convenience of expression, assume that the signature data to be verified is expressed as K’, K’ = (h’, S’), and the bit string corresponding to the user data to be verified is expressed as M’;

S41,检验h′∈[1,N-1]是否成立;若不成立,则验证不通过;若成立,则执行步骤S42;S41, check whether h′∈[1,N-1] is established; if it is not established, the verification fails; if it is established, step S42 is executed;

S42,将S′的数据类型转换成椭圆曲线上的点,检验S′∈G1是否成立;若不成立,则验证不通过;若成立,则执行步骤S43;S42, convert the data type of S′ into a point on the elliptic curve, and check whether S′∈G 1 is established; if not, the verification fails; if it is established, step S43 is executed;

S43,计算群GT中的元素g,g=e(P1,P’pub-8);P’pub-8表示系统主公钥;S43, calculate the element g in the group G T , g=e(P 1 ,P' pub-8 ); P' pub-8 represents the system master public key;

S44,计算群GT中的元素t,t=ghS44, calculate the element t in the group G T , t=g h ;

S45,计算证书h1,h1=H1(IDA||hid,N);IDA表示用户的身份标识,hid表示证书id;H1()表示安全的杂凑函数;S45, calculate certificate h 1 , h 1 =H 1 (ID A ||hid,N); ID A represents the user's identity, hid represents the certificate id; H 1 () represents a secure hash function;

S46,计算群G2中的元素P,P=[h1]P2+P’pub-s;P2表示群G2的生成元,P’pub-s表示系统主公钥;S46, calculate the element P in the group G 2 , P=[h 1 ]P 2 +P'pub-s; P 2 represents the generator of the group G 2 , and P' pub-s represents the system master public key;

S47,计算群GT中的元素u,u=e(S′,P);S47, calculate the element u in the group G T , u=e(S′, P);

S48,计算群GT中的元素w’,w’=u·t,将w’的数据类型转化成比特串;u,t分别表示系统主私钥的组成部分;S48, calculate the element w' in the group G T , w'=u·t, and convert the data type of w' into a bit string; u and t respectively represent the components of the system's master private key;

S49,计算证书h2=H2(M’||w’,N),检验h2=h’是否成立;若成立,则验证通过;否则验证不通过。S49, calculate the certificate h 2 =H 2 (M'||w', N), and check whether h 2 =h' is established; if it is established, the verification passes; otherwise, the verification fails.

需要说明的是,本发明实施例提供的供应链责任主体身份认证方法是一种采用椭圆曲线对实现的基于标识的数字签名算法,该算法的签名者持有一个标识和一个相应的签名私钥,该签名私钥由密钥生成中心通过系统主私钥和签名者的用户标识结合产生。签名者用签名私钥对数据产生数字签名,验证者用签名者的用户标识验证签名的可靠性。It should be noted that the identity authentication method of the supply chain responsible subject provided by the embodiment of the present invention is an identity-based digital signature algorithm implemented using elliptic curve pairs. The signer of this algorithm holds an identity and a corresponding signature private key. , the signature private key is generated by the key generation center through the combination of the system master private key and the signer's user ID. The signer uses the signature private key to generate a digital signature on the data, and the verifier uses the signer's user ID to verify the reliability of the signature.

进一步地,在本发明实施例提供的供应链责任主体身份认证方法中,在签名的生成和验证过程之前,均使用密码杂凑函数对待签消息M和待验证消息M′进行压缩。Furthermore, in the supply chain responsible subject identity authentication method provided by the embodiment of the present invention, before the generation and verification process of the signature, a cryptographic hash function is used to compress the message M to be signed and the message M' to be verified.

基于上述实施例的内容,作为一种可选实施例,本发明实施例提供的供应链责任主体身份认证方法,还包括:基于国密SM9算法,以根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对并根据系统主私钥和用户标识生成签名私钥。Based on the contents of the above embodiments, as an optional embodiment, the identity authentication method of the supply chain responsible subject provided by the embodiment of the present invention also includes: based on the national secret SM9 algorithm to generate the responsibility based on the identity of the responsible subject and the user password. The subject's public-private key pair and generates a signature private key based on the system master private key and user ID.

其中,用户标识可以是以包括企业名称、社会统一信用代码、地址、法人代表等信息的档案所构建的标识。The user identification may be an identification constructed from a file including company name, social unified credit code, address, legal representative and other information.

为了更清楚的说明本发明实施例提供的供应链责任主体身份认证方法的实施步骤,在本方面实施例中,为实现农产品供应链追溯中的供应链主体物理身份和数字身份的不一致性问题,从而保证操作者的物理身份与数字身份相对应,农产品供应链各追溯主体在区块链上注册时,会创建一个包括企业名称、社会统一信用代码、地址、法人代表等信息的档案。下面,将以注册者的手机号作为用户标识说明本发明实施例的一种具体应用,包括但不限于以下步骤:In order to more clearly explain the implementation steps of the supply chain responsible subject identity authentication method provided by the embodiment of the present invention, in this embodiment, in order to realize the inconsistency problem between the physical identity and digital identity of the supply chain subject in the traceability of the agricultural product supply chain, This ensures that the physical identity of the operator corresponds to the digital identity. When each traceability entity in the agricultural product supply chain registers on the blockchain, a file will be created that includes the company name, social unified credit code, address, legal representative and other information. Below, a specific application of the embodiment of the present invention will be described using the registrant's mobile phone number as the user identification, including but not limited to the following steps:

步骤1:产生签名私钥方法Step 1: Generate signature private key method

signPrivateKey=kgc.genPrivateKey(signMasterKeyPair.getPrivateKey(),id_A,userPasswd,PrivateKeyType.KEY_SIGN);signPrivateKey=kgc.genPrivateKey(signMasterKeyPair.getPrivateKey(),id_A,userPasswd,PrivateKeyType.KEY_SIGN);

其中,signPrivateKey:签名私钥;Among them, signPrivateKey: signature private key;

kgc.genPrivateKey():KGC产生私钥方法;kgc.genPrivateKey(): KGC generates private key method;

signMasterKeyPair.getPrivateKey():签名密钥对获取系统私钥;signMasterKeyPair.getPrivateKey(): The signature key pair obtains the system private key;

id_A:标识,比如13988888888;id_A: identification, such as 13988888888;

userPasswd:用户密码,默认为123456;userPasswd: user password, default is 123456;

PrivateKeyType:私钥类型PrivateKeyType: private key type

KEY_SIGN:签名私钥;KEY_SIGN: signature private key;

步骤2:签名方法Step 2: Signature method

sm9.sign(signMasterKeyPair.getPublicKey(),signPrivateKey,M.getBytes());sm9.sign(signMasterKeyPair.getPublicKey(),signPrivateKey,M.getBytes());

其中,sm9.sign():sm9签名方法;Among them, sm9.sign(): sm9 signature method;

signMasterKeyPair.getPublicKey():签名密钥对获取公钥;signMasterKeyPair.getPublicKey(): Signing key pair gets the public key;

signPrivateKey:签名私钥;signPrivateKey: signature private key;

M.getBytes():需要签名的信息M获取字节流;M.getBytes(): The information M that needs to be signed gets the byte stream;

步骤3:验签方法Step 3: Signature verification method

sm9.verify(signMasterKeyPair.getPublicKey(),id_A,M.getBytes(),signature));sm9.verify(signMasterKeyPair.getPublicKey(),id_A,M.getBytes(),signature));

其中,sm9.verify():sm9验证签名方法;Among them, sm9.verify(): sm9 verification signature method;

signMasterKeyPair.getPublicKey():签名密钥对获取公钥;signMasterKeyPair.getPublicKey(): Signing key pair gets the public key;

id_A:标识,比如13988888888;id_A: identification, such as 13988888888;

M.getBytes():需要验证签名的信息M获取字节流;M.getBytes(): The information M that needs to be verified for signature obtains the byte stream;

Signature:签名字节流。Signature: Signature byte stream.

上述步骤具体实现如下:The above steps are specifically implemented as follows:

(1)SM9的参数(SM9curve parameters)选择如下:(1) The parameters of SM9 (SM9curve parameters) are selected as follows:

方程参数b:05Equation parameter b: 05

曲线参数t:60000000 0058F98ACurve parameter t: 60000000 0058F98A

基域特征q:B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDBE56F9B27 E351457DBase domain feature q: B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDBE56F9B27 E351457D

群的阶数N:B6400000 02A3A6F1 D603AB4F F58EC744 49F2934B 18EA8BEEE56EE19C D69ECF25Order N of the group: B6400000 02A3A6F1 D603AB4F F58EC744 49F2934B 18EA8BEEE56EE19C D69ECF25

Beta:B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDB E56F9B27E351457BBeta: B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDB E56F9B27E351457B

alpha0:00alpha0:00

alpha1:B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDB E56F9B27E351457Calpha1:B6400000 02A3A6F1 D603AB4F F58EC745 21F2934B 1A7AEEDB E56F9B27E351457C

群G1生成元P1:Group G1 generates element P1:

93DE051D 62BF718F F5ED0704 487D01D6 E1E40869 09DC3280 E8C4E4817C66DDDD93DE051D 62BF718F F5ED0704 487D01D6 E1E40869 09DC3280 E8C4E4817C66DDDD

21FE8DDA 4F21E607 63106512 5C395BBC 1C1C00CB FA602435 0C464CD70A3EA61621FE8DDA 4F21E607 63106512 5C395BBC 1C1C00CB FA602435 0C464CD70A3EA616

群G2生成元P2:Group G2 generator P2:

85AEF3D0 78640C98 597B6027 B441A01F F1DD2C19 0F5E93C4 54806C11D880614185AEF3D0 78640C98 597B6027 B441A01F F1DD2C19 0F5E93C4 54806C11D8806141

37227552 92130B08 D2AAB97F D34EC120 EE265948 D19C17AB F9B7213BAF82D65B37227552 92130B08 D2AAB97F D34EC120 EE265948 D19C17AB F9B7213BAF82D65B

17509B09 2E845C12 66BA0D26 2CBEE6ED 0736A96F A347C8BD 856DC76B84EBEB9617509B09 2E845C12 66BA0D26 2CBEE6ED 0736A96F A347C8BD 856DC76B84EBEB96

A7CF28D5 19BE3DA6 5F317015 3D278FF2 47EFBA98 A71A0811 6215BBA5C999A7C7A7CF28D5 19BE3DA6 5F317015 3D278FF2 47EFBA98 A71A0811 6215BBA5C999A7C7

(2)SM9签名过程如下:(2) The SM9 signature process is as follows:

签名主密钥和用户签名私钥产生过程:The generation process of signature master key and user signature private key:

sm9 master private key:sm9 master private key:

85D5C452 624E6220 90A331D2 512BF750 F32A90EC F766A8A9 845E78C0CB6801E685D5C452 624E6220 90A331D2 512BF750 F32A90EC F766A8A9 845E78C0CB6801E6

签名主公钥Ppub-s:Signing master public key Ppub-s:

sm9 master public key:sm9 master public key:

B26709A8 A3588E68 5972B6CF 56C739C5 4A79E221 0E6C9554 93C39F0FC1316753B26709A8 A3588E68 5972B6CF 56C739C5 4A79E221 0E6C9554 93C39F0FC1316753

4729FA93 1009D8BC 7140987B B6E8D2CC 170AD6DC E6022A85 5FDDF385EE1CE9B84729FA93 1009D8BC 7140987B B6E8D2CC 170AD6DC E6022A85 5FDDF385EE1CE9B8

80A48294 96BA8AC0 FA7FF1A6 E9F09452 EE650718 E2D9BDB0 49EA3358803A9E3580A48294 96BA8AC0 FA7FF1A6 E9F09452 EE650718 E2D9BDB0 49EA3358803A9E35

6F80A6A6 B9934ADA 9627E1F1 8B214BD6 27517203 88951DA8 83856CA21470478C6F80A6A6 B9934ADA 9627E1F1 8B214BD6 27517203 88951DA8 83856CA21470478C

实体A的标识IDA:13988888888Identity IDA of entity A: 13988888888

ID A的16进制表示:31333938 38383838 383838Hexadecimal representation of ID A: 31333938 38383838 383838

用户passwd:123456User passwd:123456

用户passwd的16进制表示:31323334 3536Hexadecimal representation of user passwd: 31323334 3536

签名私钥ds_A:Signature private key ds_A:

SM9 private key:SM9 private key:

64A7A691 C0632A27 0E960674 5E950262 63359A44 C1AADEF7 48C112E8255BEA8564A7A691 C0632A27 0E960674 5E950262 63359A44 C1AADEF7 48C112E8255BEA85

B11ADCC6 02FD0F7E CC26FCF7 766B8DF1 D7A99A5D AB832A22 C71FC39D222E1ACEB11ADCC6 02FD0F7E CC26FCF7 766B8DF1 D7A99A5D AB832A22 C71FC39D222E1ACE

待签名消息M:“**有限公司”;Message to be signed M: "** Co., Ltd.";

M的16进制表示:The hexadecimal representation of M:

2A2AE69C 89E99990 E585ACE5 8FB82A2AE69C 89E99990 E585ACE5 8FB8

A1:g=e(P1,Ppub-8)A1: g=e(P1,Ppub-8)

A2:产生随机数r,A2: Generate random number r,

r=38463060478428560599688230304478404988338972700287671339516099073105502341613r=38463060478428560599688230304478404988338972700287671339516099073105502341613

A3:A3:

w=[{x=25387407373577958128899537310510008106354296005288647593086786187779936494859,y=42689362163765392019091490002214494810671461627578390713146323229168452848078},w = [{ 10671461627578390713146323229168452848078},

{x=39415410162262081548810966583637685570166404065576895886670655633049190747484,y=70143232134186640604394127098974540869178111263857364733016713409743389857872},{x=39415410162262081548810966583637685570166404065576895886670655633049190747484, y=701432321341866406043941270989745408691 78111263857364733016713409743389857872},

{x=40169016787753967686757293302447837021910497646059611771776930911049585987223,y=66409378642797489295186618554808979853838480827041913054783705834346139350886},{x=40169016787753967686757293302447837021910497646059611771776930911049585987223, y=664093786427974892951866185548089798538 38480827041913054783705834346139350886},

{x=29552723778864333757431552505862979469317059194030112118279102984868205513244,y=70270695051809392853612038836930468605767556256171923855264429729184936438930},{x=29552723778864333757431552505862979469317059194030112118279102984868205513244, y=702706950518093928536120388369304686057 67556256171923855264429729184936438930},

{x=77485204898453876845476007006929315905112531952154204079958743757480080133829,y=39831832785598908049173102649863610020865314294014422562854832309433818364089},{x=77485204898453876845476007006929315905112531952154204079958743757480080133829,y=398318327855989080491731026498636100208 65314294014422562854832309433818364089},

{x=81733983860896289520629489466185085659716647413422286199478502932331605258183,y=59820506918996338469936777769306187206009675201189565195451147683401588547802},]{x=81733983860896289520629489466185085659716647413422286199478502932331605258183, y=598205069189963384699367777693061872060 09675201189565195451147683401588547802},]

A4:A4:

h=5684319719326081095363488123625747275228985117062758645981298586619206522474h=5684319719326081095363488123625747275228985117062758645981298586619206522474

A5:A5:

l=32778740759102479504324742180852657713109987583224912693534800486486295819139l=32778740759102479504324742180852657713109987583224912693534800486486295819139

A6:A6:

s=42750716135002385234333160167459259417304341990806279140603252710584027288800,62326983540172281363013405571170190930565274372882444592220667151351682923762,0s=42750716135002385234333160167459259417304341990806279140603252710584027288800,62326983540172281363013405571170190930565 274372882444592220667151351682923762,0

A7:A7:

h=5684319719326081095363488123625747275228985117062758645981298586619206522474h=5684319719326081095363488123625747275228985117062758645981298586619206522474

消息M的签名为(h,s):sm9signature:The signature of message M is (h, s): sm9signature:

h:0C913600 A76B4BF5 742F809F 40A305F7 0ECB0F28 EEBAAE88 98631A913DD1566Ah:0C913600 A76B4BF5 742F809F 40A305F7 0ECB0F28 EEBAAE88 98631A913DD1566A

s:5E840C40 57A9623D EBFD719C 42A80612 A7C3508C 452A7117 58BAF0C35EF994E0s:5E840C40 57A9623D EBFD719C 42A80612 A7C3508C 452A7117 58BAF0C35EF994E0

89CBD293 028FD183 9B64DE2C 8E082A3C ADF65BBD B57279C7 FEA638F8D86B7CF289CBD293 028FD183 9B64DE2C 8E082A3C ADF65BBD B57279C7 FEA638F8D86B7CF2

(3)验证过程如下:(3) The verification process is as follows:

B1:检查B1: Check

h=5684319719326081095363488123625747275228985117062758645981298586619206522474in[1,82434016654578246444830763105245969129316048019845143771873730126023764135717]是否成立=trueh=5684319719326081095363488123625747275228985117062758645981298586619206522474in[1,8243401665457824644483076310524596912931 6048019845143771873730126023764135717] Whether it is established=true

B2:检查S2=trueB2: Check S2=true

B3:B3:

G2=[{x=64270714525897213109976348658049162635611633464661501967467429514136259912038,y=7198933611403195494201844805727580599447136643211639368240224616690082697798},G2 = [{ 99447136643211639368240224616690082697798},

{x=30542872938684341831572435760632268803848589464974587641808957363322247896028,y=70937393089228396994956748080764821105850249530366224304002055586102239391039},{x=30542872938684341831572435760632268803848589464974587641808957363322247896028, y=709373930892283969949567480807648211058 50249530366224304002055586102239391039},

{x=20893915644960652402727915126718410527017015990402852044587531822263893999191,y=24205433299081466643779386265960744913957040935941340759824201725943050866748},{x=20893915644960652402727915126718410527017015990402852044587531822263893999191, y=242054332990814666437793862659607449139 57040935941340759824201725943050866748},

{x=19115750410636842124886811823688111861744651529959974577554822522227818493810,y=9272787359247622645006675073285109721329542513716549877906499732354512285015},{x=19115750410636842124886811823688111861744651529959974577554822522227818493810,y=927278735924762264500667507328510972132 9542513716549877906499732354512285015},

{x=1463487778251251096036683988654861361187802949473946927010136190068736682232,y=62772827100998371456557207674727811442861965890217936278246713378653734992335},{x=1463487778251251096036683988654861361187802949473946927010136190068736682232,y=6277282710099837145655720767472781144286 1965890217936278246713378653734992335},

{x=22860290645784724137498543031120676906887744361672612081600872326053349310277,y=15128902679593305958397014788450608278693066043256596795522394403396230705399},]{x=22860290645784724137498543031120676906887744361672612081600872326053349310277,y=151289026795933059583970147884506082786 93066043256596795522394403396230705399},]

B4:B4:

t=[{x=62144650951401636982696604912456979487261096560151434351238080578400841105940,y=8529849690266475148618504134395031604689629513703720334621651352985301619488},t=[{ 04689629513703720334621651352985301619488},

{x=10337235488848171511204660805848448646242699943495391674465396001582104925338,y=63126627891429220567414992481354352083255980905022326324581788925106522479519},{x=10337235488848171511204660805848448646242699943495391674465396001582104925338,y=631266278914292205674149924813543520832 55980905022326324581788925106522479519},

{x=11111012966485206295664899268978519736347715501907754194407050632763282507303,y=33322778810983061842251918419569416204892158550528046413102359568235450647603}{x=11111012966485206295664899268978519736347715501907754194407050632763282507303, y=333227788109830618422519184195694162048 92158550528046413102359568235450647603}

{x=49354865534096654804410479841937826249959872768620208228354631603366940842194,y=50316584971276021151278262155477418860452443358156364694524359089801825426589}{x=49354865534096654804410479841937826249959872768620208228354631603366940842194, y=503165849712760211512782621554774188604 52443358156364694524359089801825426589}

{x=13426175445859155243369654124347779814265213773806439274881773759045323978081,y=18905225374638483307382241108366990676000093545432999225735547446555968080295}{x=13426175445859155243369654124347779814265213773806439274881773759045323978081, y=189052253746384833073822411083669906760 00093545432999225735547446555968080295}

{x=44884960495267794487568389686907532663979022092363585511691781778840921769798,y=21345562295621116108998638141542715733592536223093717574521704716679718858007}]。{x=44884960495267794487568389686907532663979022092363585511691781778840921769798,y=213455622956211161089986381415427157335 92536223093717574521704716679718858007}].

B5:B5:

h1=17747406270443163816538606729558334745986233638126423354797579868520096643064h1=17747406270443163816538606729558334745986233638126423354797579868520096643064

B6:B6:

P={x=20932823011935154144938787058169896994396671993155680136601491536962762835022,y=77238125973535556104201825990222313058931530462549924281874697199199442171550},{x=77686904348712971335785515411529252564005416194884699224489368102111309695122,y=57487846061866216313652706058355910770914281150977951454377955724771163349954},0P = { 8931530462549924281874697199199442171550},{x=77686904348712971335785515411529252564005416194884699224489368102111309695122, y=57487846061866216313652706058355910770914281150977951454377955724771163349954},0

B7:B7:

u=[{x=13844631013881838922959162113323859777944389820011841199076682808323358555087,y=61617086794026133545112892283754575962795429111588643334851124605802448285659},u=[{x=13844631013881838922959162113323859777944389820011841199076682808323358555087, y=616170867940261335451128922837545759 62795429111588643334851124605802448285659},

{x=68283407124097367194678109867501777523005153016828271006978850700968360380464,y=30477861310634336326503105420404219890245256057922862417942766697943931289150},{x=68283407124097367194678109867501777523005153016828271006978850700968360380464, y=304778613106343363265031054204042198902 45256057922862417942766697943931289150},

{x=1825444314893073161949387977187769254744139222408986148946750593211768025449,y=12320743182806721627515424258933253387290570744805664680682971301620434901961},{x=1825444314893073161949387977187769254744139222408986148946750593211768025449,y=1232074318280672162751542425893325338729 0570744805664680682971301620434901961},

{x=411268636388269395921672003756978951993245809081019153346552008019176936331,y=61571293667263499238202200894808137369118889224610980803474053092657245039344},{x=411268636388269395921672003756978951993245809081019153346552008019176936331, y=61571293667263499238202200894808137369118 889224610980803474053092657245039344},

{x=17723399229627305093643822899594448170526308417815203456264949796368872016472,y=7835952639063379601604530078963415993842622435162714744535475519936410246416},{x=17723399229627305093643822899594448170526308417815203456264949796368872016472, y=783595263906337960160453007896341599384 2622435162714744535475519936410246416},

{x=12126549737973630771460196238386283890987092000469626928408395733269705620771,y=38828005045470939350052798939212628940513985750430418804177573271650835257347}],{x=12126549737973630771460196238386283890987092000469626928408395733269705620771, y=388280050454709393500527989392126289405 13985750430418804177573271650835257347}],

B8:B8:

w2=[{x=25387407373577958128899537310510008106354296005288647593086786187779936494859,y=42689362163765392019091490002214494810671461627578390713146323229168452848078},w2 = [{ 810671461627578390713146323229168452848078},

{x=39415410162262081548810966583637685570166404065576895886670655633049190747484,y=70143232134186640604394127098974540869178111263857364733016713409743389857872},{x=39415410162262081548810966583637685570166404065576895886670655633049190747484, y=701432321341866406043941270989745408691 78111263857364733016713409743389857872},

{x=40169016787753967686757293302447837021910497646059611771776930911049585987223,y=66409378642797489295186618554808979853838480827041913054783705834346139350886},{x=40169016787753967686757293302447837021910497646059611771776930911049585987223, y=664093786427974892951866185548089798538 38480827041913054783705834346139350886},

{x=29552723778864333757431552505862979469317059194030112118279102984868205513244,y=70270695051809392853612038836930468605767556256171923855264429729184936438930},{x=29552723778864333757431552505862979469317059194030112118279102984868205513244, y=702706950518093928536120388369304686057 67556256171923855264429729184936438930},

{x=77485204898453876845476007006929315905112531952154204079958743757480080133829,y=39831832785598908049173102649863610020865314294014422562854832309433818364089},{x=77485204898453876845476007006929315905112531952154204079958743757480080133829,y=398318327855989080491731026498636100208 65314294014422562854832309433818364089},

{x=81733983860896289520629489466185085659716647413422286199478502932331605258183,y=59820506918996338469936777769306187206009675201189565195451147683401588547802}];{x=81733983860896289520629489466185085659716647413422286199478502932331605258183, y=598205069189963384699367777693061872060 09675201189565195451147683401588547802}];

B9:B9:

h2=5684319719326081095363488123625747275228985117062758645981298586619206522474h2=5684319719326081095363488123625747275228985117062758645981298586619206522474

0C913600 A76B4BF5 742F809F 40A305F7 0ECB0F28 EEBAAE88 98631A913DD1566A0C913600 A76B4BF5 742F809F 40A305F7 0ECB0F28 EEBAAE88 98631A913DD1566A

验证结果:h=h2 verify OK。Verification result: h=h2 verify OK.

本发明实施例还提供一种供应链责任主体身份认证系统,如图2所示,主要包括:公-私密钥生成单元11、签名私钥生成单元21、加密单元31和验证单元41。其中,公-私密钥生成单元11用于根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;签名私钥生成单元用于根据所述系统主私钥和用户标识生成签名私钥;加密单元用于利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;验证单元用于利用身份标识对签名数据进行验证。The embodiment of the present invention also provides a supply chain responsible subject identity authentication system, as shown in Figure 2, which mainly includes: a public-private key generation unit 11, a signature private key generation unit 21, an encryption unit 31 and a verification unit 41. Among them, the public-private key generation unit 11 is used to generate a public-private key pair of the responsible subject based on the identity of the responsible subject and the user password. The public-private key pair includes the system master private key and the system master public key. ; The signature private key generation unit is used to generate a signature private key based on the system master private key and user identification; the encryption unit is used to use the signature private key to digitally sign and encrypt the user data of the responsible subject, and obtain the signature data; the verification unit is used to Use the identity identifier to verify the signed data.

具体地,本发明实施例提供的供应链责任主体身份认证系统,首先利用公-私密钥生成单元11对责任主体的身份标识进行一次加密,获取系统主私钥和系统主公钥,并在一次加密的过程中融合了用户密码,有效的提高加密的安全性。然后,利用签名私钥生成单元21对系统主私钥进行二次加密,获取用户的签名私钥。在这一过程中,融和了用户标识,使得签名私钥既有用户自己设定的属性,又提高了主私钥的安全性,实现了数字签名与用户身份的对应。进一步地,通过加密单元31,利用签名私钥对用户数据进行签名,实现签名的数字化。最后,可以通过验证单元41利用责任主体的身份标识实现对签名数据的验证。Specifically, the supply chain responsible subject identity authentication system provided by the embodiment of the present invention first uses the public-private key generation unit 11 to encrypt the identity of the responsible subject once, obtains the system master private key and the system master public key, and then The user password is integrated into the primary encryption process, effectively improving encryption security. Then, the signature private key generation unit 21 is used to perform secondary encryption on the system master private key to obtain the user's signature private key. In this process, the user identity is integrated, so that the signature private key not only has the attributes set by the user, but also improves the security of the master private key, realizing the correspondence between the digital signature and the user's identity. Further, through the encryption unit 31, the user data is signed using the signature private key to realize digitization of the signature. Finally, the verification unit 41 can use the identity of the responsible subject to verify the signature data.

进一步地,本发明实施例提供的供应链责任主体身份认证系统,在具体应用上,可以添加了用户设定的密码,更优于SM2、SM3和SM9,同时适用于目前使用习惯。Furthermore, the supply chain responsible subject identity authentication system provided by the embodiment of the present invention can add a password set by the user in specific applications, which is better than SM2, SM3 and SM9, and is suitable for current usage habits.

进一步地,本发明实施例提供的供应链责任主体身份认证系统,可以应用在相关设备和软件中,同时本系统还可以被广泛使用于以标识作为物联网世界中数字身份识别、数字签名、数字验证的依据。Furthermore, the supply chain responsible subject identity authentication system provided by the embodiment of the present invention can be applied in related equipment and software. At the same time, this system can also be widely used to use identification as digital identity recognition, digital signature, and digital identification in the Internet of Things world. Basis for verification.

进一步地,本发明实施例提供的供应链责任主体身份认证系统,可以预设在safekey、装置、手机APP,也可采用计算机系统实现。Furthermore, the supply chain responsible subject identity authentication system provided by the embodiment of the present invention can be preset in safekey, device, mobile phone APP, or can be implemented using a computer system.

进一步地,本发明实施例提供的供应链责任主体身份认证系统,可以广泛应用与数字世界中,不局限于物联网、区块链、大数据等。Furthermore, the supply chain responsible subject identity authentication system provided by the embodiment of the present invention can be widely used in the digital world and is not limited to the Internet of Things, blockchain, big data, etc.

本发明实施例提供的供应链责任主体身份认证系统,在产生系统主私钥和签名私钥时加入了用户设定的密码,在使用签名时需要由用户标识、用户密码双重验证后进行签名,提升了主私钥和签名私钥的安全性,能有效防止验证不准确或者用户资料泄漏的问题发生。The supply chain responsible subject identity authentication system provided by the embodiment of the present invention adds the password set by the user when generating the system master private key and signature private key. When using a signature, it is necessary to double-verify the user ID and user password before signing. The security of the master private key and signature private key has been improved, which can effectively prevent inaccurate verification or leakage of user information.

需要说明的是,本发明实施例提供的供应链责任主体身份认证系统,在被具体执行时,可以基于上述任一实施例所述的供应链责任主体身份认证方法来实现,对此本实施例不作赘述。It should be noted that the supply chain responsible subject identity authentication system provided by the embodiment of the present invention, when implemented, can be implemented based on the supply chain responsible subject identity authentication method described in any of the above embodiments. In this regard, this embodiment No further details will be given.

图3示例了一种电子设备的实体结构示意图,如图3所示,该电子设备可以包括:处理器(processor)310、通信接口(Communications Interface)320、存储器(memory)330和通信总线340,其中,处理器310,通信接口320,存储器330通过通信总线340完成相互间的通信。处理器310可以调用存储器330中的逻辑指令,以执行供应链责任主体身份认证方法,该方法包括:根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;根据系统主私钥和用户标识生成签名私钥;利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;利用身份标识对签名数据进行验证。Figure 3 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 3, the electronic device may include: a processor (processor) 310, a communications interface (Communications Interface) 320, a memory (memory) 330 and a communication bus 340. Among them, the processor 310, the communication interface 320, and the memory 330 complete communication with each other through the communication bus 340. The processor 310 can call the logical instructions in the memory 330 to execute the supply chain responsible subject identity authentication method. The method includes: generating a public-private key pair of the responsible subject according to the identity of the responsible subject and the user password, public-private key pair. The key pair includes the system master private key and the system master public key; generate a signature private key based on the system master private key and user identification; use the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain signature data; use the identity identifier to sign Data is verified.

此外,上述的存储器330中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logical instructions in the memory 330 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. .

另一方面,本发明实施例还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的供应链责任主体身份认证方法,该方法包括:根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;根据系统主私钥和用户标识生成签名私钥;利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;利用身份标识对签名数据进行验证。On the other hand, embodiments of the present invention also provide a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions When executed by a computer, the computer can execute the supply chain responsible subject identity authentication method provided by the above method embodiments. The method includes: generating a public-private key pair of the responsible subject based on the responsible subject's identity and user password, and public-private key pair. The private key pair includes the system master private key and the system master public key; generate a signature private key based on the system master private key and user identification; use the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain the signature data; use the identity identifier Verify signed data.

又一方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的以执行供应链责任主体身份认证方法,该方法包括:根据责任主体的身份标识和用户密码生成责任主体的公-私密钥对,公-私密钥对包括系统主私钥和系统主公钥;根据系统主私钥和用户标识生成签名私钥;利用签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;利用身份标识对签名数据进行验证。On the other hand, embodiments of the present invention also provide a non-transitory computer-readable storage medium on which a computer program is stored. The computer program is implemented when executed by a processor to perform the supply chain responsibility provided by the above embodiments. Subject identity authentication method, which method includes: generating a public-private key pair of the responsible subject based on the identity identifier and user password of the responsible subject. The public-private key pair includes the system master private key and the system master public key; Key and user identification are used to generate a signature private key; the signature private key is used to digitally sign and encrypt the user data of the responsible subject to obtain the signature data; the identity identification is used to verify the signature data.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the part of the above technical solution that essentially contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., including a number of instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be used Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1.一种供应链责任主体身份认证方法,其特征在于,包括:1. A supply chain responsibility subject identity authentication method, characterized by including: 根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,所述公-私密钥对包括系统主私钥和系统主公钥;Generate the public-private key pair of the responsible subject based on the identity of the responsible subject and the user password, and the public-private key pair includes the system master private key and the system master public key; 根据所述系统主私钥和用户标识生成签名私钥;Generate a signature private key based on the system master private key and user identification; 利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;Use the signature private key to digitally sign and encrypt the user data of the responsible subject to obtain the signature data; 利用所述身份标识对签名数据进行验证;Verify the signature data using the identity identifier; 所述利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据,包括:The use of the signature private key to digitally sign and encrypt the user data of the responsible subject and obtain the signature data includes: S31,计算关于用户数据的群GT中的元素g,g=e(P1,Ppub-8);元素g表示中间加密结果;e表示从群G1×G2到群GT的双线性对,G1和G2表示加法循环群,GT为乘法循环群,群G1、G2和GT有相同的阶数;P1表示群G1的生成元,Ppub-8表示系统主私钥;S31, calculate the element g in the group G T about the user data, g=e(P 1 ,P pub-8 ); the element g represents the intermediate encryption result; e represents the double from the group G 1 × G 2 to the group G T Linear pair, G 1 and G 2 represent the additive cyclic group, G T is the multiplicative cyclic group, the groups G 1 , G 2 and G T have the same order; P 1 represents the generator of the group G 1 , P pub-8 Represents the system master private key; S32,产生随机数r,r∈[1,N-1];r表示在预定范围内所选取的随机数,N表示群G1、G2和GT的阶数;S32, generate a random number r, r∈[1,N-1]; r represents a random number selected within a predetermined range, and N represents the order of groups G 1 , G 2 and G T ; S33,计算群GT中的元素w,w=gr,将w的数据类型转换为比特串;w表示密文的组成部分;S33, calculate the element w in the group G T , w=g r , and convert the data type of w into a bit string; w represents the component of the ciphertext; S34,计算证书h,h=H2(M||w,N);h表示证书,H2()表示安全的杂凑函数,M表示与用户数据对应的比特串,符号||表示关联运算关系;S34, calculate the certificate h, h=H 2 (M||w, N); h represents the certificate, H 2 () represents the secure hash function, M represents the bit string corresponding to the user data, and the symbol || represents the associated operation relationship ; S35,计算证书ll=(r-h)mod N;若l=0则返回步骤S32;若l≠0,则进入步骤S36;S35, calculate the certificate l , l =(rh)mod N; if l =0, return to step S32; if l ≠0, enter step S36; S36,计算群G1中的元素S,S=[l]dsA;dsA表示签名私钥,[l] dsA表示将l与dsA进行点乘运算;S36, calculate the element S in the group G 1 , S=[ l ]ds A ; ds A represents the signature private key, [ l ] ds A represents the dot multiplication operation of l and ds A ; S37,获取所述签名数据K,K=(h,S);S37, obtain the signature data K, K=(h, S); 所述利用所述身份标识对签名数据进行验证,包括:The use of the identity identifier to verify the signature data includes: 设待验证签名数据表示为K’,K’=(h’,S’),与待验证用户数据对应的比特串表示为M’;Assume that the signature data to be verified is represented by K’, K’=(h’, S’), and the bit string corresponding to the user data to be verified is represented by M’; S41,检验h´∈[1,N-1]是否成立;若不成立,则验证不通过;若成立,则执行步骤S42;S41, check whether h´∈[1,N-1] is established; if it is not established, the verification fails; if it is established, step S42 is executed; S42,将S´的数据类型转换成椭圆曲线上的点,检验S´∈G1是否成立;若不成立,则验证不通过;若成立,则执行步骤S43;S42, convert the data type of S´ into a point on the elliptic curve, and check whether S´∈G 1 is true; if not, the verification fails; if true, step S43 is executed; S43,计算群GT中的元素g,g=e(P1,P’pub-8);P’pub-8表示系统主公钥;S43, calculate the element g in the group G T , g=e(P 1 ,P' pub-8 ); P' pub-8 represents the system master public key; S44,计算群GT中的元素t,t=ghS44, calculate the element t in the group G T , t=g h ; S45,计算证书h1,h1=H1(IDA||hid,N);IDA表示用户的身份标识,hid表示证书id;H1()表示安全的杂凑函数;S45, calculate certificate h 1 , h 1 =H 1 (ID A ||hid,N); ID A represents the user's identity, hid represents the certificate id; H 1 () represents a secure hash function; S46,计算群G2中的元素P,P=[h1]P2+P’pub-s;P2表示群G2的生成元,P’pub-s表示系统主公钥;S46, calculate the element P in group G 2 , P=[h 1 ]P 2 +P'pub-s; P 2 represents the generator of group G 2 , and P' pub-s represents the system master public key; S47,计算群GT中的元素u,u=e(S´,P);S47, calculate the element u in the group G T , u=e(S´, P); S48,计算群GT中的元素w’,w’=u·t,将w’的数据类型转化成比特串;u,t分别表示系统主私钥的组成部分;S48, calculate the element w' in the group G T , w'=u·t, and convert the data type of w' into a bit string; u and t respectively represent the components of the system's master private key; S49,计算证书h2=H2(M’||w’,N),检验h2=h’是否成立;若成立,则验证通过;否则验证不通过。S49, calculate the certificate h 2 =H 2 (M'||w', N) and check whether h 2 =h' is established; if it is established, the verification passes; otherwise, the verification fails. 2.根据权利要求1所述的供应链责任主体身份认证方法,其特征在于,所述根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,包括:2. The supply chain responsible subject identity authentication method according to claim 1, characterized in that generating the public-private key pair of the responsible subject based on the identity identifier and user password of the responsible subject includes: 利用密钥生成中心,对所述责任主体的身份标识和用户密码进行一次哈希加密,生成所述公-私密钥对,并将所述系统主公钥发布至区块链进行公开。The key generation center is used to perform a hash encryption on the identity of the responsible subject and the user password, generate the public-private key pair, and publish the system master public key to the blockchain for disclosure. 3.根据权利要求1所述的供应链责任主体身份认证方法,其特征在于,所述根据所述系统主私钥和用户标识生成签名私钥,包括:3. The supply chain responsible subject identity authentication method according to claim 1, characterized in that generating a signature private key based on the system master private key and user identification includes: 利用密钥生成中心,对所述系统主私钥和用户标识进行二次哈希加密,生成所述签名私钥。The key generation center is used to perform secondary hash encryption on the system master private key and user identification to generate the signature private key. 4.根据权利要求1所述的供应链责任主体身份认证方法,其特征在于,还包括:4. The supply chain responsibility subject identity authentication method according to claim 1, characterized in that it further includes: 基于国密SM9算法,以根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对并根据所述系统主私钥和用户标识生成签名私钥。Based on the national secret SM9 algorithm, the public-private key pair of the responsible subject is generated based on the identity of the responsible subject and the user password, and the signature private key is generated based on the system master private key and user identification. 5.根据权利要求1所述的供应链责任主体身份认证方法,其特征在于,所述用户标识为:以包括企业名称、社会统一信用代码、地址、法人代表信息的档案所构建的标识。5. The supply chain responsible subject identity authentication method according to claim 1, characterized in that the user identification is: an identification constructed from a file including company name, social unified credit code, address, and legal representative information. 6.一种供应链责任主体身份认证系统,其特征在于,包括:公-私密钥生成单元、签名私钥生成单元、加密单元和验证单元;6. A supply chain responsible subject identity authentication system, characterized by including: a public-private key generation unit, a signature private key generation unit, an encryption unit and a verification unit; 所述公-私密钥生成单元用于根据责任主体的身份标识和用户密码生成所述责任主体的公-私密钥对,所述公-私密钥对包括系统主私钥和系统主公钥;The public-private key generation unit is used to generate a public-private key pair of the responsible subject based on the identity of the responsible subject and the user password. The public-private key pair includes the system master private key and the system master public key. key; 所述签名私钥生成单元用于根据所述系统主私钥和用户标识生成签名私钥;The signature private key generation unit is used to generate a signature private key based on the system master private key and user identification; 所述加密单元用于利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据;The encryption unit is used to digitally sign and encrypt the user data of the responsible subject using the signature private key to obtain the signature data; 所述验证单元用于利用所述身份标识对签名数据进行验证;The verification unit is used to verify the signature data using the identity identifier; 其中,所述利用所述签名私钥对责任主体的用户数据进行数字签名加密,获取签名数据,包括:Wherein, the use of the signature private key to digitally sign and encrypt the user data of the responsible subject and obtain the signature data includes: S31,计算关于用户数据的群GT中的元素g,g=e(P1,Ppub-8);元素g表示中间加密结果;e表示从群G1×G2到群GT的双线性对,G1和G2表示加法循环群,GT为乘法循环群,群G1、G2和GT有相同的阶数;P1表示群G1的生成元,Ppub-8表示系统主私钥;S31, calculate the element g in the group G T about the user data, g=e(P 1 ,P pub-8 ); the element g represents the intermediate encryption result; e represents the double from the group G 1 × G 2 to the group G T Linear pair, G 1 and G 2 represent the additive cyclic group, G T is the multiplicative cyclic group, the groups G 1 , G 2 and G T have the same order; P 1 represents the generator of the group G 1 , P pub-8 Represents the system master private key; S32,产生随机数r,r∈[1,N-1];r表示在预定范围内所选取的随机数,N表示群G1、G2和GT的阶数;S32, generate a random number r, r∈[1,N-1]; r represents a random number selected within a predetermined range, and N represents the order of groups G 1 , G 2 and G T ; S33,计算群GT中的元素w,w=gr,将w的数据类型转换为比特串;w表示密文的组成部分;S33, calculate the element w in the group G T , w=g r , and convert the data type of w into a bit string; w represents the component of the ciphertext; S34,计算证书h,h=H2(M||w,N);h表示证书,H2()表示安全的杂凑函数,M表示与用户数据对应的比特串,符号||表示关联运算关系;S34, calculate the certificate h, h=H 2 (M||w, N); h represents the certificate, H 2 () represents the secure hash function, M represents the bit string corresponding to the user data, and the symbol || represents the associated operation relationship ; S35,计算证书ll=(r-h)mod N;若l=0则返回步骤S32;若l≠0,则进入步骤S36;S35, calculate the certificate l , l =(rh)mod N; if l =0, return to step S32; if l ≠0, enter step S36; S36,计算群G1中的元素S,S=[l]dsA;dsA表示签名私钥,[l] dsA表示将l与dsA进行点乘运算;S36, calculate the element S in the group G 1 , S=[ l ]ds A ; ds A represents the signature private key, [ l ] ds A represents the dot multiplication operation of l and ds A ; S37,获取所述签名数据K,K=(h,S);S37, obtain the signature data K, K=(h, S); 所述利用所述身份标识对签名数据进行验证,包括:The use of the identity identifier to verify the signature data includes: 设待验证签名数据表示为K’,K’=(h’,S’),与待验证用户数据对应的比特串表示为M’;Assume that the signature data to be verified is represented by K’, K’=(h’, S’), and the bit string corresponding to the user data to be verified is represented by M’; S41,检验h´∈[1,N-1]是否成立;若不成立,则验证不通过;若成立,则执行步骤S42;S41, check whether h´∈[1,N-1] is established; if it is not established, the verification fails; if it is established, step S42 is executed; S42,将S´的数据类型转换成椭圆曲线上的点,检验S´∈G1是否成立;若不成立,则验证不通过;若成立,则执行步骤S43;S42, convert the data type of S´ into a point on the elliptic curve, and check whether S´∈G 1 is true; if not, the verification fails; if true, step S43 is executed; S43,计算群GT中的元素g,g=e(P1,P’pub-8);P’pub-8表示系统主公钥;S43, calculate the element g in the group G T , g=e(P 1 ,P' pub-8 ); P' pub-8 represents the system master public key; S44,计算群GT中的元素t,t=ghS44, calculate the element t in the group G T , t=g h ; S45,计算证书h1,h1=H1(IDA||hid,N);IDA表示用户的身份标识,hid表示证书id;H1()表示安全的杂凑函数;S45, calculate certificate h 1 , h 1 =H 1 (ID A ||hid,N); ID A represents the user's identity, hid represents the certificate id; H 1 () represents a secure hash function; S46,计算群G2中的元素P,P=[h1]P2+P’pub-s;P2表示群G2的生成元,P’pub-s表示系统主公钥;S46, calculate the element P in group G 2 , P=[h 1 ]P 2 +P'pub-s; P 2 represents the generator of group G 2 , and P' pub-s represents the system master public key; S47,计算群GT中的元素u,u=e(S´,P);S47, calculate the element u in the group G T , u=e(S´, P); S48,计算群GT中的元素w’,w’=u·t,将w’的数据类型转化成比特串;u,t分别表示系统主私钥的组成部分;S48, calculate the element w' in the group G T , w'=u·t, and convert the data type of w' into a bit string; u and t respectively represent the components of the system's master private key; S49,计算证书h2=H2(M’||w’,N),检验h2=h’是否成立;若成立,则验证通过;否则验证不通过。S49, calculate the certificate h 2 =H 2 (M'||w', N) and check whether h 2 =h' is established; if it is established, the verification passes; otherwise, the verification fails. 7.一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至5任一项所述供应链责任主体身份认证方法的步骤。7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the program, it implements any one of claims 1 to 5 The steps of the supply chain responsibility subject identity authentication method described in the item. 8.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1至5任一项所述供应链责任主体身份认证方法的步骤。8. A computer-readable storage medium with a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the supply chain responsible subject identity authentication method according to any one of claims 1 to 5 are implemented. .
CN202010743844.0A 2020-07-29 2020-07-29 Identity authentication method and system for supply chain responsibility main body Active CN112069547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010743844.0A CN112069547B (en) 2020-07-29 2020-07-29 Identity authentication method and system for supply chain responsibility main body

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010743844.0A CN112069547B (en) 2020-07-29 2020-07-29 Identity authentication method and system for supply chain responsibility main body

Publications (2)

Publication Number Publication Date
CN112069547A CN112069547A (en) 2020-12-11
CN112069547B true CN112069547B (en) 2023-12-08

Family

ID=73656726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010743844.0A Active CN112069547B (en) 2020-07-29 2020-07-29 Identity authentication method and system for supply chain responsibility main body

Country Status (1)

Country Link
CN (1) CN112069547B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114650126A (en) * 2020-12-21 2022-06-21 宁波和利时信息安全研究院有限公司 Industrial data transmission method and device, storage medium and electronic equipment
CN112712357B (en) * 2020-12-30 2025-02-07 赵月言 A multi-institution, multi-chain, multi-currency, and multi-account private key management method and system
CN112699394B (en) * 2021-01-13 2022-11-25 北卡科技有限公司 SM9 algorithm-based key application method
CN112966291A (en) * 2021-04-13 2021-06-15 宁波和利时信息安全研究院有限公司 Identity management method, industrial control system and storage medium
CN113032814B (en) * 2021-04-28 2022-06-24 华南理工大学 Internet of things data management method and system
CN115412250B (en) * 2021-05-28 2024-05-10 浪潮卓数大数据产业发展有限公司 SM9 key generation center authentication method, device, equipment and medium
CN114499883A (en) * 2022-02-09 2022-05-13 浪潮云信息技术股份公司 Cross-organization identity authentication method and system based on blockchain and SM9 algorithm
CN114547681A (en) * 2022-02-15 2022-05-27 北京无字天书科技有限公司 Private key generation method and related method, system, computer device and storage medium
CN115242480B (en) * 2022-07-15 2024-10-11 京东方科技集团股份有限公司 Device access method, system and non-volatile computer storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014125206A1 (en) * 2013-02-15 2014-08-21 Orange Cryptographic method for generating a pair of user keys for an entity having a public identifier i, and system
CN108173639A (en) * 2018-01-22 2018-06-15 中国科学院数据与通信保护研究教育中心 A Two-Party Cooperative Signature Method Based on SM9 Signature Algorithm
CN108809658A (en) * 2018-07-20 2018-11-13 武汉大学 A kind of digital signature method and system of the identity base based on SM2
CN108989054A (en) * 2018-08-30 2018-12-11 武汉理工大学 A kind of cryptographic system and digital signature method
CN109951288A (en) * 2019-01-22 2019-06-28 中国科学院信息工程研究所 A Hierarchical Signature Method and System Based on SM9 Digital Signature Algorithm
CN110880977A (en) * 2019-11-26 2020-03-13 武汉大学 Safe and efficient SM9 ring signature generation and verification method
CN110896351A (en) * 2019-11-14 2020-03-20 湖南盾神科技有限公司 Identity-based digital signature method based on global hash
CN110912708A (en) * 2019-11-26 2020-03-24 武汉大学 Ring signature generation method based on SM9 digital signature algorithm
CN110943976A (en) * 2019-11-08 2020-03-31 中国电子科技网络信息安全有限公司 A password-based user signature private key management method
CN111010272A (en) * 2019-12-20 2020-04-14 武汉理工大学 A kind of identification private key generation and digital signature method, system and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014125206A1 (en) * 2013-02-15 2014-08-21 Orange Cryptographic method for generating a pair of user keys for an entity having a public identifier i, and system
CN108173639A (en) * 2018-01-22 2018-06-15 中国科学院数据与通信保护研究教育中心 A Two-Party Cooperative Signature Method Based on SM9 Signature Algorithm
CN108809658A (en) * 2018-07-20 2018-11-13 武汉大学 A kind of digital signature method and system of the identity base based on SM2
CN108989054A (en) * 2018-08-30 2018-12-11 武汉理工大学 A kind of cryptographic system and digital signature method
CN109951288A (en) * 2019-01-22 2019-06-28 中国科学院信息工程研究所 A Hierarchical Signature Method and System Based on SM9 Digital Signature Algorithm
CN110943976A (en) * 2019-11-08 2020-03-31 中国电子科技网络信息安全有限公司 A password-based user signature private key management method
CN110896351A (en) * 2019-11-14 2020-03-20 湖南盾神科技有限公司 Identity-based digital signature method based on global hash
CN110880977A (en) * 2019-11-26 2020-03-13 武汉大学 Safe and efficient SM9 ring signature generation and verification method
CN110912708A (en) * 2019-11-26 2020-03-24 武汉大学 Ring signature generation method based on SM9 digital signature algorithm
CN111010272A (en) * 2019-12-20 2020-04-14 武汉理工大学 A kind of identification private key generation and digital signature method, system and device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
A blockchain-based certificateless public key signature scheme for vehicle-to-infrastructure communication in VANETs;Ikram Ali 等;Journal of Systems Architecture;第99卷;1-17 *
Secure and efficient handover authentication based on bilinear pairing functions;Daojing He 等;IEEE Transactions on Wireless Communications;第11卷(第1期);48-53 *
可监管匿名认证方案;王震 等;软件学报;第30卷(第06期);1705-1720 *
基于双线性配对的可验证签密方案;黄梦桥 等;计算机工程;第30卷(第01期);1705-1720 *
基于证书的无双线性对的代理签名方案;周才学;数学的实践与认识;第45卷(第07期);199-208 *

Also Published As

Publication number Publication date
CN112069547A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN112069547B (en) Identity authentication method and system for supply chain responsibility main body
US11936774B2 (en) Determining a common secret for the secure exchange of information and hierarchical, deterministic cryptographic keys
CN106961336B (en) A kind of key components trustship method and system based on SM2 algorithm
Bhatia et al. Towards a secure incremental proxy re‐encryption for e‐healthcare data sharing in mobile cloud computing
US7765582B2 (en) Identity-based-encryption messaging system with public parameter host servers
Velliangiri et al. An efficient lightweight privacy-preserving mechanism for industry 4.0 based on elliptic curve cryptography
CN107483212A (en) A kind of method of both sides' cooperation generation digital signature
JP2005500740A (en) ID-based encryption and related cryptosystem systems and methods
CN101179380A (en) A two-way authentication method, system and network terminal
CN114095181B (en) Threshold ring signature method and system based on cryptographic algorithm
JP2022528925A (en) Computer-implemented methods and systems for encrypting data
Hosen et al. SPTM-EC: A security and privacy-preserving task management in edge computing for IIoT
CN115801223A (en) CA certificate-based identification key system and PKI system compatible method
NL1043779B1 (en) Method for electronic signing and authenticaton strongly linked to the authenticator factors possession and knowledge
Prabakaran et al. Secure channel for financial transactions in cloud environment using blockchain technology
Rehman et al. Securing cloud storage by remote data integrity check with secured key generation
CN114844643B (en) Method and electronic device for obtaining adapter signature based on bilinear mapping
Hossain et al. A Smart Contract Based Blockchain Approach Integrated with Elliptic Curve Cryptography for Secure Email Application
Li et al. A cloud based dual-root trust model for secure mobile online transactions
Kirupanithi et al. Hierarchical deterministic protocol for the defragmentation of identity in a blockchain-based framework
CN114301612A (en) Information processing method, communication apparatus, and encryption apparatus
Ichsani et al. The Cryptocurrency Simulation using Elliptic Curve Cryptography Algorithm in Mining Process from Normal, Failed, and Fake Bitcoin Transactions
Pedrosa et al. Holder-of-key threshold access token for anonymous data resources
Nagaty A secured hybrid cloud architecture for mhealth care
Téllez et al. Security in mobile payment systems

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
GR01 Patent grant
GR01 Patent grant