CN114338091A - Data transmission method and device, electronic equipment and storage medium - Google Patents
Data transmission method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114338091A CN114338091A CN202111493588.5A CN202111493588A CN114338091A CN 114338091 A CN114338091 A CN 114338091A CN 202111493588 A CN202111493588 A CN 202111493588A CN 114338091 A CN114338091 A CN 114338091A
- Authority
- CN
- China
- Prior art keywords
- request
- ciphertext
- key
- key information
- service
- 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.)
- Granted
Links
Images
Landscapes
- Storage Device Security (AREA)
Abstract
本申请公开了一种数据传输方法、装置、电子设备及存储介质。其中,所述方法应用于客户端,包括:调用第一软件开发工具包SDK,基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文;向服务器发送第一请求;所述第一请求中携带所述第一密文;所述第一请求用于请求处理所述第一业务;接收所述服务器基于所述第一请求返回的第二密文;所述第二密文由所述服务器基于所述第一请求对所述第一密文的第一处理结果进行加密得到;调用所述第一SDK对所述第二密文进行解密,生成第一明文;基于所述第一明文,处理所述第一业务。
The present application discloses a data transmission method, device, electronic device and storage medium. Wherein, applying the method to the client includes: invoking a first software development kit SDK, encrypting the first data about the first service based on at least one encryption method supported by the first SDK, and generating a first ciphertext; send a first request to the server; the first request carries the first ciphertext; the first request is used to request processing of the first service; receive a response from the server based on the first request the second ciphertext; the second ciphertext is obtained by the server encrypting the first processing result of the first ciphertext based on the first request; calling the first SDK to encrypt the second ciphertext Decrypt the text to generate a first plaintext; and process the first service based on the first plaintext.
Description
技术领域technical field
本申请涉及信息安全技术领域,尤其涉及一种数据传输方法、装置、电子设备及存储介质。The present application relates to the technical field of information security, and in particular, to a data transmission method, device, electronic device and storage medium.
背景技术Background technique
相关技术中,为了保证数据在传输过程中的安全性,会对传输数据进行加密,由于不同的数据加密方式存在一定的安全漏洞或者存在适用场景的限制,导致数据加密的效率与数据的安全性降低的问题。In the related art, in order to ensure the security of data during the transmission process, the transmission data will be encrypted. Due to the existence of certain security loopholes or limitations of applicable scenarios in different data encryption methods, the efficiency of data encryption and the security of data are caused. lowering problem.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请实施例提供一种数据传输方法、装置、电子设备及存储介质,以至少解决相关技术出现的数据加密的效率与数据的安全性降低的问题。In view of this, embodiments of the present application provide a data transmission method, apparatus, electronic device, and storage medium, so as to at least solve the problems of reduced data encryption efficiency and data security in the related art.
本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:
本申请实施例提供了一种数据传输方法,应用于客户端,所述方法包括:An embodiment of the present application provides a data transmission method, which is applied to a client, and the method includes:
调用第一软件开发工具包(SDK,Software Development Kit),基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文;calling a first software development kit (SDK, Software Development Kit), and based on at least one encryption method supported by the first SDK, encrypts the first data about the first service, and generates a first ciphertext;
向服务器发送第一请求;所述第一请求中携带所述第一密文;所述第一请求用于请求处理所述第一业务;sending a first request to the server; the first request carries the first ciphertext; the first request is used to request processing of the first service;
接收所述服务器基于所述第一请求返回的第二密文;所述第二密文由所述服务器基于所述第一请求对所述第一密文的第一处理结果进行加密得到;receiving the second ciphertext returned by the server based on the first request; the second ciphertext is obtained by the server encrypting the first processing result of the first ciphertext based on the first request;
调用所述第一SDK对所述第二密文进行解密,生成第一明文;calling the first SDK to decrypt the second ciphertext to generate the first plaintext;
基于所述第一明文,处理所述第一业务。Based on the first plaintext, the first service is processed.
本申请实施例提供了另一种数据传输方法,应用于服务器,所述方法包括:The embodiment of the present application provides another data transmission method, which is applied to a server, and the method includes:
接收客户端发送的第一请求;所述第一请求携带第一密文;所述第一密文表征关于第一业务的第一数据的加密结果;所述第一请求用于请求处理所述第一业务;Receive the first request sent by the client; the first request carries the first ciphertext; the first ciphertext represents the encryption result of the first data about the first service; the first request is used to request processing of the first business;
调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果;所述第一解密结果表征关于所述第一请求的解密结果;calling the second software development kit SDK, and generating a first decryption result according to the encryption method of the first ciphertext; the first decryption result represents the decryption result about the first request;
根据所述第一解密结果,对所述第一业务进行处理,生成第一处理结果;processing the first service according to the first decryption result to generate a first processing result;
调用所述第二SDK对所述第一处理结果进行加密,生成第二密文;calling the second SDK to encrypt the first processing result to generate a second ciphertext;
将所述第二密文返回至所述客户端。The second ciphertext is returned to the client.
本申请实施例还提供了另一种数据传输方法,应用于密钥管理平台,所述方法包括:The embodiment of the present application also provides another data transmission method, which is applied to the key management platform, and the method includes:
接收客户端或服务器发送的密钥管理请求;Receive key management requests sent by clients or servers;
根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应;According to the key management request, invoking a key service corresponding to the request, and generating a response to the key management request;
将关于所述密钥管理请求的响应返回至所述客户端或服务器。A response to the key management request is returned to the client or server.
本申请实施例还提供了一种数据传输装置,应用于客户端,包括:The embodiment of the present application also provides a data transmission device, which is applied to a client, including:
第二接收单元,用于接收客户端发送的第一请求;所述第一请求携带第一密文;所述第一密文表征关于第一业务的第一数据的加密结果;所述第一请求用于请求处理所述第一业务;The second receiving unit is configured to receive the first request sent by the client; the first request carries the first ciphertext; the first ciphertext represents the encryption result of the first data about the first service; the first ciphertext the request is used to request processing of the first service;
第二解密单元,用于调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果;所述第一解密结果表征关于所述第一请求的解密结果;a second decryption unit, configured to call a second software development kit SDK, and generate a first decryption result according to the encryption method of the first ciphertext; the first decryption result represents a decryption result about the first request;
第二处理单元,用于根据所述第一解密结果,对所述第一业务进行处理,生成第一处理结果;a second processing unit, configured to process the first service according to the first decryption result to generate a first processing result;
第二加密单元,用于调用所述第二SDK对所述第一处理结果进行加密,生成第二密文;a second encryption unit, configured to call the second SDK to encrypt the first processing result and generate a second ciphertext;
第二发送单元,将所述第二密文返回至所述客户端。The second sending unit returns the second ciphertext to the client.
本申请实施例还提供了一种数据传输装置,应用于密钥管理平台,包括:The embodiment of the present application also provides a data transmission device, which is applied to a key management platform, including:
第三接收单元,用于接收客户端或服务器发送的密钥管理请求;a third receiving unit, configured to receive a key management request sent by the client or the server;
第一生成单元,用于根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应;a first generating unit, configured to invoke a key service corresponding to the request according to the key management request, and generate a response to the key management request;
第三发送单元,将关于所述密钥管理请求的响应返回至所述客户端或服务器。The third sending unit returns a response to the key management request to the client or server.
本申请实施例还提供了一种电子设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,Embodiments of the present application also provide an electronic device, including: a processor and a memory for storing a computer program that can be executed on the processor,
其中,所述处理器用于运行所述计算机程序时,执行上述任一方法的步骤。Wherein, when the processor is configured to execute the steps of any of the above methods when running the computer program.
本申请实施例还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方法的步骤。Embodiments of the present application further provide a storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of any of the foregoing methods.
在本申请实施例中,客户端通过调用客户端上的软件开发工具包为第一业务的数据进行加密,并为服务器返回的关于第一业务的处理结果的密文进行解密,从而能够保证第一业务的数据在传输过程中的安全性的同时,还能通用的数据加密或解密的基础设施,从而能够提高数据加密和解密的效率。In the embodiment of the present application, the client encrypts the data of the first service by invoking the software development kit on the client, and decrypts the ciphertext of the processing result of the first service returned by the server, so as to ensure the first In addition to the security of the data of a service in the transmission process, it can also use a general data encryption or decryption infrastructure, so that the efficiency of data encryption and decryption can be improved.
附图说明Description of drawings
图1为本申请一实施例提供的密钥管理的服务架构示意图;FIG. 1 is a schematic diagram of a service architecture of key management provided by an embodiment of the present application;
图2为本申请一实施例提供的密钥管理的技术架构示意图;2 is a schematic diagram of a technical architecture of key management provided by an embodiment of the present application;
图3为本申请一实施例提供的数据传输方法的实现流程示意图;FIG. 3 is a schematic diagram of an implementation flowchart of a data transmission method provided by an embodiment of the present application;
图4为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 4 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图5为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 5 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图6为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 6 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图7为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 7 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图8为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 8 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图9为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 9 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图10为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 10 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图11为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 11 is a schematic flowchart of an implementation of a data transmission method provided by another embodiment of the present application;
图12为本申请又一实施例提供的数据传输方法的实现流程示意图;FIG. 12 is a schematic diagram of an implementation flowchart of a data transmission method provided by another embodiment of the present application;
图13为本申请一应用实施例提供的密钥管理技术架构对RSA数字信封的处理流程示意图;13 is a schematic diagram of the processing flow of the RSA digital envelope provided by the key management technology framework provided by an application embodiment of the present application;
图14为本申请又一应用实施例提供的密钥管理技术架构对ECC数字信封的处理流程示意图;14 is a schematic diagram of the processing flow of the ECC digital envelope provided by the key management technology framework provided by another application embodiment of the present application;
图15为本申请又一应用实施例提供的密钥管理技术架构对基于客户端与服务器之间的通信密钥加密的第一密文的处理流程示意图;15 is a schematic flowchart of processing the first ciphertext encrypted based on the communication key between the client and the server according to the key management technology framework provided by another application embodiment of the present application;
图16为本申请又一应用实施例提供的密钥管理技术架构登记密钥的处理流程;FIG. 16 is a process flow of registering a key in a key management technical framework provided by another application embodiment of the present application;
图17为本申请又一应用实施例提供的密钥管理技术架构的业务证书升级的处理流程;FIG. 17 is a processing flow of a service certificate upgrade of a key management technical framework provided by another application embodiment of the present application;
图18为本申请又一应用实施例提供的密钥申请业务接入流程;FIG. 18 is a key application service access process provided by another application embodiment of the present application;
图19为本申请一实施例提供的数据传输装置的结构示意图;FIG. 19 is a schematic structural diagram of a data transmission apparatus provided by an embodiment of the application;
图20为本申请又一实施例提供的数据传输装置的结构示意图;FIG. 20 is a schematic structural diagram of a data transmission apparatus provided by another embodiment of the present application;
图21为本申请又一实施例提供的数据传输装置的结构示意图;FIG. 21 is a schematic structural diagram of a data transmission apparatus provided by another embodiment of the present application;
图22为本申请一实施例提供电子设备的硬件组成结构示意图。FIG. 22 is a schematic structural diagram of a hardware composition of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图及具体实施例对本申请作进一步详细的说明。The present application will be described in further detail below with reference to the accompanying drawings and specific embodiments.
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
需要说明的是,本申请实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。It should be noted that the technical solutions described in the embodiments of the present application may be combined arbitrarily unless there is a conflict.
另外,在本申请实施例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
另外,本文中术语“至少一个”表示多个中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。In addition, the term "at least one" herein refers to any one of a plurality or any combination of at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B and any one or more elements selected from the set of C.
相关技术中,对于相同的业务,存在不同的安全合规政策,为此不同的设计团队为满足安全合规政策,设计了不同的加密方案与解密方案,并且部分加密方案与解密方案存在较高的安全漏洞,例如,将加密密钥信息追加到统一资源定位器(url,Uniform ResourceLocator)请求中,导致数据传输的安全性减弱。In related technologies, there are different security compliance policies for the same business. For this reason, different design teams have designed different encryption schemes and decryption schemes to meet the security compliance policies, and some encryption schemes and decryption schemes have higher The security vulnerability of, for example, appending encryption key information to Uniform Resource Locator (url, Uniform ResourceLocator) requests, resulting in weakened security of data transmission.
基于此,在本申请实施例提供的方案能够提供一套标准化的加密方案与解密方案,并且还能保证数据在传输过程中的安全性。Based on this, the solutions provided in the embodiments of the present application can provide a set of standardized encryption solutions and decryption solutions, and can also ensure the security of data during transmission.
在对本申请实施例的技术方案进行详细说明之前,首先对本申请实施例应用的密钥管理的服务架构与密钥管理的技术架构进行相应的介绍。Before the technical solutions of the embodiments of the present application are described in detail, the service architecture of the key management and the technical architecture of the key management applied by the embodiments of the present application are first introduced correspondingly.
如图1所示,图1示出了密钥管理的服务架构示意图。在密钥管理的服务架构中,能够处理RSA数字信封、椭圆加密算法(ECC,Elliptic curve cryptography)数字信封,以及基于Noise框架传输的数据,其中,RSA数字信封是基于RSA加密算法对数据进行加密所生成的,RSA加密算法是一种非对称的加密算法。ECC数字信封是基于ECC加密算法对数据进行加密所生成的。Noise框架是一个用于构建安全协议的框架,为网络协议提供安全信道,从而可以保证数据在传输过程中的安全性。As shown in FIG. 1 , FIG. 1 shows a schematic diagram of the service architecture of key management. In the service architecture of key management, it can process RSA digital envelopes, elliptic encryption algorithm (ECC, Elliptic curve cryptography) digital envelopes, and data transmitted based on the Noise framework, wherein the RSA digital envelope is based on the RSA encryption algorithm to encrypt data. As a result, the RSA encryption algorithm is an asymmetric encryption algorithm. The ECC digital envelope is generated by encrypting data based on the ECC encryption algorithm. The Noise framework is a framework for building secure protocols, providing secure channels for network protocols so that data security can be guaranteed during transmission.
基于密钥管理的服务架构的处理场景,能够提供不同的密钥管理服务,包括密钥登记、密钥协商和流量卸载,其中,不同的密钥管理服务需要调用相应的密钥管理能力协助实现,密钥管理能力包括密钥配置、业务证书分发、密钥采集、协议鉴权、密钥协商等。在实际应用中,密钥管理能力还需要依赖一定的工具,在密钥管理服务架构中,基础设施层提供了密钥管理服务(KMS,Key Management Service)工具、公钥基础设施(PKI,Public KeyInfrastructure)等,KMS工具能够确定解密的密钥,PKI能够实现证书的产生、管理、存储、分发和撤销等功能。例如,当需要对ECC数字信封中的密钥进行登记,首先要利用密钥协商服务,通过密钥协商的密钥管理能力从KMS工具中,确定解密ECC数字信封的密钥,在获取密钥后,提供密钥登记服务,通过密钥存储的密钥管理能力从PKI中完成密钥的登记。In the processing scenario of the service architecture based on key management, it can provide different key management services, including key registration, key negotiation, and traffic offloading. Different key management services need to call the corresponding key management capabilities to assist in the implementation. , and key management capabilities include key configuration, service certificate distribution, key collection, protocol authentication, and key negotiation. In practical applications, key management capabilities also need to rely on certain tools. In the key management service architecture, the infrastructure layer provides key management service (KMS, Key Management Service) tools, public key infrastructure (PKI, Public Key Infrastructure), etc., KMS tools can determine the decryption key, and PKI can realize the functions of certificate generation, management, storage, distribution and revocation. For example, when it is necessary to register the key in the ECC digital envelope, the key agreement service should be used first to determine the key for decrypting the ECC digital envelope from the KMS tool through the key management capability of key agreement, and then obtain the key. Afterwards, the key registration service is provided to complete the key registration from the PKI through the key management capability of the key storage.
如图2所示,图2示出了密钥管理的技术架构示意图,在图2中的技术架构中,包括了接入层、应用层、领域层和基础设施层,其中,接入层能够供客户端、服务器、客户端的SDK、服务器的SDK以及运营后台接入,从而调用密钥管理的技术架构中的不同层,完成不同的密钥管理。在实际应用中,客户端的SDK与服务器的SDK集成密钥装卸和流量装卸的能力。应用层中提供了密钥运营、密钥登记以及密钥协商,当接入层调用应用层进行相应的处理的情况下,能够触发领域层的对应能力,领域层中包括密钥管理、密钥同步、密钥协商、密钥采集、业务鉴权等不同的能力,并依赖于基础设施层中的不同工具,完成接入层发起的密钥管理,其中,基础设施层中含有KMS、PKI等。As shown in Figure 2, Figure 2 shows a schematic diagram of the technical architecture of key management. The technical architecture in Figure 2 includes an access layer, an application layer, a domain layer, and an infrastructure layer. The access layer can For client, server, client SDK, server SDK and operation background access, so as to call different layers in the technical architecture of key management to complete different key management. In practical applications, the client's SDK and the server's SDK integrate the capabilities of key loading and unloading and traffic loading and unloading. The application layer provides key operation, key registration, and key negotiation. When the access layer calls the application layer for corresponding processing, it can trigger the corresponding capabilities of the domain layer. The domain layer includes key management, key It has different capabilities such as synchronization, key negotiation, key collection, and service authentication, and relies on different tools in the infrastructure layer to complete key management initiated by the access layer. The infrastructure layer includes KMS, PKI, etc. .
下面结合附图及具体实施例对本申请作进一步详细的说明。The present application will be described in further detail below with reference to the accompanying drawings and specific embodiments.
本申请实施例提供了一种数据传输方法,图3为本申请实施例的数据传输方法的一种流程示意图,如图3所示,所述方法应用于客户端,所述方法包括:An embodiment of the present application provides a data transmission method, and FIG. 3 is a schematic flowchart of a data transmission method according to an embodiment of the present application. As shown in FIG. 3 , the method is applied to a client, and the method includes:
S301:调用第一SDK,基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文。S301: Invoke a first SDK to encrypt first data about a first service based on at least one encryption method supported by the first SDK to generate a first ciphertext.
客户端上配置标准化的第一SDK,第一SDK集成了一定的能力,例如,第一SDK可以进行数据的加密、数据的解密等。A standardized first SDK is configured on the client, and the first SDK integrates certain capabilities. For example, the first SDK can perform data encryption and data decryption.
第一业务为客户端上进行的数据交互业务,例如,在登录网站的过程中,第一业务可以为登录验证服务,第一业务也可以付款业务,第一业务还可以为数据查询业务等。The first service is a data interaction service performed on the client. For example, in the process of logging in to a website, the first service may be a login verification service, a payment service, and a data query service.
客户端在进行第一业务的处理过程中,存在客户端与服务器之间的数据交互的需求,例如,第一业务为付款业务的情况下,客户端需要将付款信息、付款密码等信息传输给服务器,服务器根据客户端传输的信息进行相应的验证和数据处理,从而完成付款,其中,客户端传输给服务器的付款信息、付款密码等信息,属于隐私信息,如果在传输的过程中被窃取或泄露,将会影响账户的安全,因此,需要将与第一业务相关的第一数据进行加密后传输给服务器。客户端可以调用第一SDK,为第一数据进行加密,生成第一密文,第一密文为第一数据的加密结果。In the process of processing the first service, the client needs to exchange data between the client and the server. For example, when the first service is a payment service, the client needs to transmit payment information, payment password and other information to the client. The server, the server performs corresponding verification and data processing according to the information transmitted by the client, so as to complete the payment. Among them, the payment information, payment password and other information transmitted by the client to the server belong to private information, if it is stolen or stolen during the transmission process. Leakage will affect the security of the account. Therefore, the first data related to the first service needs to be encrypted and then transmitted to the server. The client can call the first SDK to encrypt the first data to generate a first ciphertext, where the first ciphertext is an encryption result of the first data.
第一SDK上集成了不同的加密方式,可以通过第一SDK支持的加密方式对第一数据进行加密,在实际应用中,可以根据第一业务的传输要求选择第一数据的加密方式,例如,在第一业务的传输要求更注重数据的安全性的情况下,在第一SDK支持的加密方式中选择加密安全性最高的加密方式,相应的加密时间会增加,导致第一数据的传输时间也会相应的增加。在第一业务的传输要求更倾向数据的处理效率的情况下,在第一SDK支持的加密方式中选择传输效率最高的加密方式,相应的加密时间会缩短,从而能够减少第一数据的传输时间。The first SDK integrates different encryption methods, and the first data can be encrypted by the encryption methods supported by the first SDK. In practical applications, the encryption method of the first data can be selected according to the transmission requirements of the first service, for example, Under the circumstance that the transmission of the first service requires more emphasis on data security, selecting the encryption method with the highest encryption security among the encryption methods supported by the first SDK, the corresponding encryption time will increase, resulting in the transmission time of the first data being also will increase accordingly. In the case that the transmission requirements of the first service tend to be more efficient in data processing, selecting the encryption method with the highest transmission efficiency among the encryption methods supported by the first SDK, the corresponding encryption time will be shortened, thereby reducing the transmission time of the first data. .
S302:向服务器发送第一请求;所述第一请求中携带所述第一密文;所述第一请求用于请求处理所述第一业务。S302: Send a first request to a server; the first request carries the first ciphertext; the first request is used to request processing of the first service.
在完成第一数据加密的情况下,需要请求服务器协助完成第一业务的处理,从而客户端可以向服务器发送第一请求,其中,第一请求为请求信息,第一请求中携带了第一密文,从而能够在第一数据随着请求发送的过程中得到保护。In the case of completing the first data encryption, the server needs to be requested to assist in completing the processing of the first service, so that the client can send a first request to the server, where the first request is request information, and the first request carries the first password. Therefore, the first data can be protected during the process of sending the first data along with the request.
S303:接收所述服务器基于所述第一请求返回的第二密文;所述第二密文由所述服务器基于所述第一请求对所述第一密文的第一处理结果进行加密得到。S303: Receive the second ciphertext returned by the server based on the first request; the second ciphertext is obtained by the server encrypting the first processing result of the first ciphertext based on the first request .
在服务器完成对第一请求的处理后,客户端能够接收服务器基于第一请求返回的第二密文,第二密文中含有对第一业务的处理结果,客户端通过对第一密文进行解密,能够获取第一业务的处理结果。After the server finishes processing the first request, the client can receive the second ciphertext returned by the server based on the first request. The second ciphertext contains the processing result of the first service, and the client decrypts the first ciphertext by decrypting the first request. , the processing result of the first service can be obtained.
S304:调用所述第一SDK对所述第二密文进行解密,生成第一明文。S304: Invoke the first SDK to decrypt the second ciphertext to generate a first plaintext.
服务器返回的第二密文是基于第一密文的加密方式加密得到的,客户端可以调用第一SDK,对第二密文进行解密,从而得到第二密文的解密结果。在实际应用中,对第二密文的解密过程与对第一密文的加密过程相反。The second ciphertext returned by the server is encrypted based on the encryption method of the first ciphertext, and the client can call the first SDK to decrypt the second ciphertext to obtain the decryption result of the second ciphertext. In practical applications, the decryption process for the second ciphertext is opposite to the encryption process for the first ciphertext.
S305:基于所述第一明文,处理所述第一业务。S305: Based on the first plaintext, process the first service.
客户端根据第一明文,能够完成第一业务的后续处理,例如,第一业务为付款业务的情况下,获取的第一明文可以为表征支付成功的信息,从而客户端上可以显示支付成功的页面,完成了付款业务的处理。获取的第一明文还可以表征支付失败的信息,从而客户端上可以显示支付失败的页面,继续进行付款业务的处理。The client can complete the follow-up processing of the first service according to the first plaintext. For example, when the first service is a payment service, the acquired first plaintext may be information indicating successful payment, so that the client can display the successful payment. page to complete the processing of the payment business. The acquired first plaintext can also represent the payment failure information, so that the payment failure page can be displayed on the client and continue to process the payment service.
在本申请实施例中,第一SDK能够支持三种加密方式,下面通过不同的实施例介绍通过三种加密方式对第一数据进行加密的过程以及对三种加密方式加密得到的数据进行解密的过程。In the embodiment of the present application, the first SDK can support three encryption methods. The following describes the process of encrypting the first data by using the three encryption methods and the method of decrypting the data encrypted by the three encryption methods. process.
在一实施例中,所述基于所述第一SDK支持的至少一种加密方式,对所述第一数据进行加密,生成所述第一密文,包括:In one embodiment, encrypting the first data based on at least one encryption method supported by the first SDK to generate the first ciphertext includes:
在所述第一SDK支持的至少一种加密方式中选择第一加密方式或第二加密方式的情况下,基于第一加密方式的第一加密算法或第二加密方式的第二加密算法,根据客户端的第一私钥信息与服务器的第一公钥信息,对所述第一数据进行加密,生成所述第一密文;第一加密算法为RAS算法;所述第二加密算法为椭圆曲线ECC算法。In the case where the first encryption method or the second encryption method is selected from at least one encryption method supported by the first SDK, based on the first encryption algorithm of the first encryption method or the second encryption algorithm of the second encryption method, according to the The first private key information of the client and the first public key information of the server encrypt the first data to generate the first ciphertext; the first encryption algorithm is the RAS algorithm; the second encryption algorithm is an elliptic curve ECC algorithm.
第一加密方式是基于RSA算法对第一数据进行加密,生成第一密文,第一密文的具体生成过程为:首先确定客户端的第一私钥信息,其中,第一私钥信息可以为随机产生的对称密钥信息,利用客户端的第一私钥信息对第一数据进行加密,从而得到关于第一数据的加密结果A,再利用服务器的第一公钥信息通过RSA算法对客户端的第一私钥信息进行加密,得到关于客户端的第一私钥信息的加密结果B,将加密结果A与加密结果B进行组合,得到第一密文,在实际应用中,第一密文称为第一数据的数字信封,由于第一密文是使用第一加密方式加密得到的,因而第一密文为RSA数字信封。The first encryption method is to encrypt the first data based on the RSA algorithm to generate the first ciphertext. The specific generating process of the first ciphertext is as follows: first determine the first private key information of the client, wherein the first private key information may be: The randomly generated symmetric key information is used to encrypt the first data with the first private key information of the client, so as to obtain the encryption result A of the first data, and then use the first public key information of the server to encrypt the first data of the client through the RSA algorithm. A private key information is encrypted to obtain an encryption result B about the client's first private key information, and the encryption result A and the encryption result B are combined to obtain the first ciphertext. In practical applications, the first ciphertext is called the first ciphertext. For a digital envelope of data, since the first ciphertext is obtained by encrypting with the first encryption method, the first ciphertext is an RSA digital envelope.
第二加密方式是基于ECC算法对第一数据进行加密,生成第一密文。第一密文的具体生成过程为:首先确定客户端的第一私钥信息,根据客户端的第一私钥信息,用椭圆曲线迪菲-赫尔曼秘钥交换(ECDH,Elliptic Curve Diffie Hellman key Exchange),得到AES密钥,通过AES密钥对第一数据进行加密,得到关于第一数据的加密结果A,再利对客户端的AES密钥进行加密,得到关于客户端的第一私钥信息的加密结果B,基于加密结果A与加密结果B,能够生成第一密文。在实际应用中,第一密文为ECC数字信封。The second encryption method is to encrypt the first data based on the ECC algorithm to generate the first ciphertext. The specific generation process of the first ciphertext is as follows: first determine the first private key information of the client, and use the Elliptic Curve Diffie Hellman key exchange (ECDH, Elliptic Curve Diffie Hellman key Exchange) according to the first private key information of the client. ), obtain the AES key, encrypt the first data by the AES key, obtain the encryption result A about the first data, and then encrypt the AES key of the client, obtain the encryption about the first private key information of the client As a result B, based on the encryption result A and the encryption result B, the first ciphertext can be generated. In practical applications, the first ciphertext is an ECC digital envelope.
第二加密方式相对于第一加密方式而言,具有更高的安全性,在对第一数据进行加密过程中的处理速度也会比第一加密方式更快,并且,在第二加密方式在加密的过程中,生成的AES密钥的尺寸会比第一加密方式在加密过程中生成的密钥尺寸小,从而不需要较多的存储资源。Compared with the first encryption method, the second encryption method has higher security, and the processing speed in the process of encrypting the first data is also faster than the first encryption method. During the encryption process, the size of the generated AES key will be smaller than the size of the key generated by the first encryption method during the encryption process, so that more storage resources are not required.
在第二密文的加密方式为第一加密方式或第二加密方式的情况下,所述调用所述第一SDK对所述第二密文进行解密,生成第一明文,包括:When the encryption method of the second ciphertext is the first encryption method or the second encryption method, the calling the first SDK to decrypt the second ciphertext to generate the first plaintext includes:
根据服务器的第二私钥信息对所述第二密文进行解密,生成所述第一明文;所述服务器的第二私钥信息是基于客户端的第二公钥信息确定的。The second ciphertext is decrypted according to the second private key information of the server to generate the first plaintext; the second private key information of the server is determined based on the second public key information of the client.
服务器返回的第二密文是基于第一密文的加密方式加密得到的,当客户端接收到的第二密文是基于第一加密方式或第二加密方式加密的情况下,第一SDK能够对第二密文进行解密,在实际应用中,对第二密文的解密过程与对第一密文的加密过程相反。The second ciphertext returned by the server is encrypted based on the encryption method of the first ciphertext. When the second ciphertext received by the client is encrypted based on the first encryption method or the second encryption method, the first SDK can Decrypt the second ciphertext. In practical applications, the decryption process of the second ciphertext is opposite to the encryption process of the first ciphertext.
在第二密文是基于第一加密方式加密得到的情况下,第二密文为RSA数字信封,首先利用客户端的私钥对RSA数字信封进行解密,得到服务器的第二私钥信息,服务器的第二私钥信息是用于加密第一处理结果从而生成第二密文,进而可以通过服务器的第二私钥信息对加密的第一处理结果进行解密,从而得到第一明文。In the case where the second ciphertext is obtained by encrypting based on the first encryption method, the second ciphertext is an RSA digital envelope, and the RSA digital envelope is first decrypted by using the private key of the client to obtain the second private key information of the server. The second private key information is used to encrypt the first processing result to generate the second ciphertext, and then the encrypted first processing result can be decrypted through the second private key information of the server to obtain the first plaintext.
在第二密文是基于第二加密方式加密得到的情况下,第二密文为ECC数字信封,首先利用客户端的私钥对ECC数字信封进行解密,得到服务器的第二私钥信息,服务器的第二私钥信息是用于加密第一处理结果从而生成第二密文,进而可以通过服务器的第二私钥信息对加密的第一处理结果进行解密,从而得到第一明文。In the case where the second ciphertext is encrypted based on the second encryption method, and the second ciphertext is an ECC digital envelope, the ECC digital envelope is first decrypted using the client's private key to obtain the server's second private key information. The second private key information is used to encrypt the first processing result to generate the second ciphertext, and then the encrypted first processing result can be decrypted through the second private key information of the server to obtain the first plaintext.
在一实施例中,如图4所示,所述基于所述第一SDK支持的至少一种加密方式,对所述第一数据进行加密,生成所述第一密文,包括:In one embodiment, as shown in FIG. 4 , encrypting the first data based on at least one encryption method supported by the first SDK to generate the first ciphertext includes:
S401:在所述第一SDK支持的至少一种加密方式中选择第三加密方式的情况下,向密钥管理平台发送第二请求;所述第二请求用于请求分配客户端与服务器之间的通信密钥信息。S401: In the case where a third encryption method is selected from at least one encryption method supported by the first SDK, send a second request to the key management platform; the second request is used to request distribution between the client and the server communication key information.
第三加密方式是通过客户端与服务器之间的通信密钥信息对第一数据进行加密,其中,客户端与服务器之间的通信密钥信息是由密钥管理平台分配。密钥管理平台用于对密钥进行管理,提供密钥登记、密钥分发等不同的密钥管理服务。The third encryption method is to encrypt the first data through the communication key information between the client and the server, wherein the communication key information between the client and the server is distributed by the key management platform. The key management platform is used to manage keys and provide different key management services such as key registration and key distribution.
客户端通过向密钥管理平台发送第二请求,获取密钥管理平台分配的客户端与服务器之间的通信密钥信息。The client obtains the communication key information between the client and the server distributed by the key management platform by sending a second request to the key management platform.
在实际应用中,客户端基于第一SDK生成客户端的临时公钥信息与临时私钥信息,调用initialize函数对协商状态机(HS,Handshake State-machine)进行初始化,协商状态机是用于确定客户端与服务器之间的握手状态,并调用write_message函数对HS进行更新,生成第一缓存数据buffer1,其中,第一缓存数据buffer1中含有第一SDK生成的客户端的临时公钥信息、以及签名信息等其他信息。客户端基于第一SDK向密钥管理平台发送第二请求中携带有第一缓存数据buffer1。In practical applications, the client generates the client's temporary public key information and temporary private key information based on the first SDK, and calls the initialize function to initialize the negotiation state machine (HS, Handshake State-machine). The negotiation state machine is used to determine the client The handshake state between the client and the server, and call the write_message function to update the HS to generate the first cached data buffer1, wherein the first cached data buffer1 contains the client's temporary public key information and signature information generated by the first SDK. other information. The client sends the second request to the key management platform based on the first SDK, which carries the first cached data buffer1.
S402:接收所述密钥管理平台返回的关于所述第二请求的第一响应;所述第一响应包括第一密钥信息和第二密钥信息。S402: Receive a first response about the second request returned by the key management platform; the first response includes first key information and second key information.
密钥管理平台对第二请求处理完成后,客户端能够接收到密钥管理平台返回的第一密钥信息与第二密钥信息,其中,第一密钥信息与第二密钥信息为客户端与服务器之间的通信密钥信息。After the key management platform completes the processing of the second request, the client can receive the first key information and the second key information returned by the key management platform, wherein the first key information and the second key information are the client Communication key information between the client and the server.
客户端接收到的第一响应为利用客户端的临时公钥信息加密生成的第二缓存数据buffer2,第一SDK调用write_message函数对HS进行更新,并且对第二缓存数据buffer2进行解密,从而能够得到第一密钥信息与第二密钥信息。The first response received by the client is the second cached data buffer2 encrypted and generated by using the temporary public key information of the client. The first SDK calls the write_message function to update the HS, and decrypts the second cached data buffer2, so as to obtain the first response. a key information and a second key information.
S403:根据所述第一密钥信息加密所述第一数据,生成所述第一密文。S403: Encrypt the first data according to the first key information to generate the first ciphertext.
利用第一密钥信息对第一数据进行加密,从而生成第一密文。The first data is encrypted by using the first key information, thereby generating a first ciphertext.
在第二密文的加密方式为第三加密方式的情况下,所述调用所述第一SDK对所述第二密文进行解密,生成第一明文,包括:When the encryption method of the second ciphertext is the third encryption method, the calling the first SDK to decrypt the second ciphertext to generate the first plaintext, including:
通过所述第二密钥信息,对所述第二密文进行解密,生成所述第一明文。Using the second key information, the second ciphertext is decrypted to generate the first plaintext.
客户端通过第二请求向密钥管理平台请求分配客户端与服务器之间的通信密钥信息,同样地,服务器也能向密钥管理平台获取客户端与服务器之间的通信密钥信息。在密钥管理平台分配的通信密钥信息中,当客户端使用第一密钥信息对数据进行加密,那么服务器将使用第二密钥信息对数据进行加密,在这种情况下,客户端能够通过第二密钥信息对第二密文进行解密,得到第一明文。The client requests the key management platform to allocate the communication key information between the client and the server through the second request. Similarly, the server can also obtain the communication key information between the client and the server from the key management platform. In the communication key information distributed by the key management platform, when the client uses the first key information to encrypt data, the server will use the second key information to encrypt the data. In this case, the client can Decrypt the second ciphertext through the second key information to obtain the first plaintext.
在一实施例中,如图5所示,所述方法还包括:In one embodiment, as shown in FIG. 5 , the method further includes:
S501:向密钥管理平台发送第三请求;所述第三请求用于请求登记客户端的第二公钥信息以使所述服务器根据所述第二公钥信息对所述第一处理结果进行加密。S501: Send a third request to the key management platform; the third request is used to request to register the second public key information of the client, so that the server encrypts the first processing result according to the second public key information .
第一SDK在利用第一加密方式或第二加密方式对第一数据进行加密的过程中,会生成客户端的第一私钥信息,在生成客户端的第一私钥信息的同时,还可以生成客户端的第二公钥信息,其中,服务器可以利用第二公钥信息对传输给客户端的数据进行加密。在实际应用中,服务器可以通过密钥管理平台获取客户端的第二公钥信息,为了保证服务器能够从密钥管理平台获取客户端的第二公钥信息,需要客户端向密钥管理平台登记第二公钥信息。在实际应用中,客户端向密钥管理平台发起登记密钥的第三请求,用于使密钥管理平台对第二公钥信息进行登记,其中,第三请求中携带第二公钥信息,在实际应用中,为了保证第二公钥信息在传输过程中的数据安全,第三请求中携带的是第二公钥信息的加密结果。During the process of encrypting the first data with the first encryption method or the second encryption method, the first SDK will generate the first private key information of the client, and at the same time of generating the first private key information of the client, it can also generate the client The second public key information of the client, wherein the server can encrypt the data transmitted to the client by using the second public key information. In practical applications, the server can obtain the second public key information of the client through the key management platform. In order to ensure that the server can obtain the second public key information of the client from the key management platform, the client needs to register the second public key information with the key management platform. public key information. In practical applications, the client initiates a third request for registering the key to the key management platform, so that the key management platform registers the second public key information, wherein the third request carries the second public key information, In practical applications, in order to ensure data security of the second public key information during transmission, the third request carries the encryption result of the second public key information.
S502:接收所述密钥管理平台返回的关于所述第三请求的第二响应;所述第二响应表征所述第二公钥信息是否登记成功。S502: Receive a second response about the third request returned by the key management platform; the second response represents whether the registration of the second public key information is successful.
密钥管理平台根据第二公钥信息的登记情况作出第二响应,客户端能够接收第二响应,从而能够根据第二响应确定第二公钥信息的登记情况。The key management platform makes a second response according to the registration situation of the second public key information, and the client can receive the second response, so that the registration situation of the second public key information can be determined according to the second response.
在一实施例中,如图6所示,所述方法还包括:In one embodiment, as shown in FIG. 6 , the method further includes:
S601:向密钥管理平台发送第四请求;所述第四请求用于请求获取新版本的业务证书;所述业务证书包括所述服务器的第一公钥信息。S601: Send a fourth request to a key management platform; the fourth request is used to request to obtain a new version of a service certificate; the service certificate includes first public key information of the server.
业务证书为服务器的数字证书,是一个经证书授权中心数字签名的文件,最简单的业务证书中含有服务器的第一公钥信息、服务器的名称以及证书授权中心的数字签名,一般情况下,业务证书中还包括服务器的第一公钥信息的有效时间、发证机关的名称、业务证书的序列号等不同的信息。The business certificate is the digital certificate of the server, which is a file digitally signed by the certificate authority. The simplest business certificate contains the first public key information of the server, the name of the server and the digital signature of the certificate authority. The certificate also includes different information such as the valid time of the first public key information of the server, the name of the issuing authority, the serial number of the business certificate, and the like.
在第一加密方式与第二加密方式下,需要服务器的第一公钥信息对第一数据进行加密,因此,客户端需要获取服务器的第一公钥信息。在实际应用中,客户端可以通过密钥管理平台中查询服务器的第一公钥信息,并将第一公钥信息进行保存,从而能够利用保存的第一公钥信息对第一数据进行加密。由于服务器的第一公钥信息存在有效时间,或者,服务器的第一公钥信息可能会发生改变,因此客户端可以定期向密钥管理平台查询业务证书是否发生变化,客户端通过向密钥管理平台发送第四请求,以使密钥管理平台获取服务器的最新版本的业务证书。In the first encryption mode and the second encryption mode, the first public key information of the server is required to encrypt the first data. Therefore, the client needs to obtain the first public key information of the server. In practical applications, the client can query the first public key information of the server through the key management platform, and store the first public key information, so that the first data can be encrypted by using the stored first public key information. Since the first public key information of the server has a valid time, or the first public key information of the server may change, the client can periodically query the key management platform whether the service certificate has changed. The platform sends a fourth request, so that the key management platform obtains the latest version of the service certificate of the server.
S602:接收所述密钥管理平台基于所述第四请求返回的第三响应;所述第三响应表征最新版本的业务证书。S602: Receive a third response returned by the key management platform based on the fourth request; the third response represents the latest version of the service certificate.
客户端接收第三响应,其中,第三响应包括服务器的最新版本的业务证书,客户端还可以对业务证书进行保存,从而能够利用最新版本的业务证书中的服务器的第一公钥信息对第一数据进行加密,能够保证服务器对第一密文解密成功,进行第一业务的相关处理。此外,客户端还可以根据服务器的业务证书,对服务器进行验证,从而避免客户端将第一数据传输到非法的服务器。The client receives a third response, where the third response includes the latest version of the service certificate of the server, and the client can also save the service certificate, so that the first public key information of the server in the latest version of the service certificate can be used to interpret the first public key information of the server. Encrypting one data can ensure that the server successfully decrypts the first ciphertext and performs related processing of the first service. In addition, the client can also verify the server according to the service certificate of the server, thereby preventing the client from transmitting the first data to an illegal server.
在本申请实施例中,第一SDK提供了标准化的加密方式与解密方式,客户端通过调用第一SDK完成数据的加密与数据的解密,从而能够保证客户端与服务器之间的数据传输的安全性的同时,也可以避免客户端利用存在较高的安全漏洞的加密方式对数据进行加密,还能提高数据的加密效率。In the embodiment of the present application, the first SDK provides a standardized encryption method and decryption method, and the client completes data encryption and data decryption by calling the first SDK, thereby ensuring the security of data transmission between the client and the server. At the same time, it can also prevent the client from encrypting the data by using the encryption method with high security loopholes, and can also improve the encryption efficiency of the data.
本申请是实例还提供了另一种数据传输方法,如图7所示,所述方法应用于服务器,包括:This application is an example and also provides another data transmission method, as shown in FIG. 7 , the method is applied to the server, including:
S701:接收客户端发送的第一请求;所述第一请求携带第一密文;所述第一密文表征关于第一业务的第一数据的加密结果;所述第一请求用于请求处理所述第一业务。S701: Receive a first request sent by a client; the first request carries a first ciphertext; the first ciphertext represents an encryption result of first data about a first service; the first request is used to request processing the first business.
接收客户端的第一请求,客户端通过第一请求,请求服务器对第一业务进行相应的处理,第一业务为客户端上进行的数据交互业务,例如,第一业务为登录验证服务的情况下,客户端通过第一请求,请求服务器对登录验证服务进行相应的处理,服务器会根据关于第一业务的第一数据确认是否通过验证,其中,为了保证客户端与服务器的传输数据的安全性,服务器接收到的是加密后的第一数据,在实际应用中,服务器接收到的第一请求中携带了关于第一数据的第一密文,第一密文为第一数据的加密结果。Receive the first request from the client, and the client requests the server to perform corresponding processing on the first service through the first request. The first service is the data interaction service performed on the client. For example, when the first service is a login verification service , the client requests the server to perform corresponding processing on the login verification service through the first request, and the server will confirm whether the verification is passed according to the first data about the first service, wherein, in order to ensure the security of the transmission data between the client and the server, What the server receives is the encrypted first data. In practical applications, the first request received by the server carries the first ciphertext about the first data, and the first ciphertext is the encryption result of the first data.
S702:调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果;所述第一解密结果表征关于所述第一请求的解密结果。S702: Invoke a second software development kit SDK, and generate a first decryption result according to the encryption method of the first ciphertext; the first decryption result represents a decryption result about the first request.
服务器需要对第一密文进行解密后,才能根据第一密文对第一业务进行相应的处理,其中,服务器可以通过调用第二SDK对第一密文进行解密,第二SDK上集成了不同的功能,例如,第二SDK可以实现数据的加密与数据的解密。The server needs to decrypt the first ciphertext before performing corresponding processing on the first service according to the first ciphertext. The server can decrypt the first ciphertext by calling the second SDK, and the second SDK integrates different For example, the second SDK can implement data encryption and data decryption.
通过第一密文的加密方式,对第一密文进行解密,从而得到第一解密结果,其中,对第一密文的解密是对第一数据的加密的逆过程。The first ciphertext is decrypted by the encryption method of the first ciphertext, thereby obtaining a first decryption result, wherein the decryption of the first ciphertext is an inverse process of the encryption of the first data.
在一实施例中,如图8所示,所述调用所述第二SDK,根据所述第一密文的加密方式,生成第一解密结果,包括:In one embodiment, as shown in FIG. 8 , the calling of the second SDK generates a first decryption result according to the encryption method of the first ciphertext, including:
S801:在所述客户端适用非证书类鉴权的情况下,调用所述第二SDK,确定第二处理结果;所述第二处理结果表征所述客户端的鉴权结果。S801: In the case that the client side applies non-certificate authentication, call the second SDK to determine a second processing result; the second processing result represents the authentication result of the client.
第二SDK还集成了鉴权的功能。在实际应用中,对客户端进行鉴权可以通过证书类鉴权,也可以通过非证书类鉴权,其中证书类鉴权由于需要通过密钥管理服务平台获取客户端的证书,因而一般在密钥管理平台进行证书类鉴权,在本实施例中,第二SDK的业务鉴权功能适用于简单的业务鉴权,并不适用证书类鉴权。第二SDK在客户端适用非证书类鉴权的情况下,对客户端进行鉴权,得到第二处理结果。The second SDK also integrates the authentication function. In practical applications, the client can be authenticated through certificate-based authentication or non-certificate-based authentication. Among them, certificate-based authentication needs to obtain the client's certificate through the key management service platform. The management platform performs certificate-based authentication. In this embodiment, the service authentication function of the second SDK is suitable for simple service authentication, and does not apply to certificate-based authentication. The second SDK authenticates the client when the client applies non-certificate authentication, and obtains the second processing result.
S802:在所述第二处理结果表征所述客户端具有访问所述服务器的权利的情况下,调用所述第二SDK,根据所述第一密文的加密方式,生成所述第一解密结果。S802: In the case that the second processing result indicates that the client has the right to access the server, call the second SDK, and generate the first decryption result according to the encryption method of the first ciphertext .
在第二处理结果表征客户端具有访问服务器的权利的情况下,表明客户端为合法的客户端,第一请求是由客户端发出的,并不存在其他非法的客户端盗取信息以获取服务器的处理结果,因而可以对第一密文进行解密,并对第一业务进行后续的处理。In the case where the second processing result indicates that the client has the right to access the server, it indicates that the client is a legitimate client, the first request is sent by the client, and there is no other illegal client stealing information to obtain the server Therefore, the first ciphertext can be decrypted, and subsequent processing of the first service can be performed.
S803:在所述第二处理结果表征所述客户端不具有访问所述服务器的权利的情况下,向所述客户端返回的关于所述第一请求的第四响应;所述第四响应表征拒绝处理所述第一业务。S803: In the case that the second processing result represents that the client does not have the right to access the server, return a fourth response to the client regarding the first request; the fourth response represents refuse to process the first service.
在第二处理结果表征客户端不具有访问服务器的权利的情况下,表明客户端为非法客户端,非法客户端通过截取合法客户端向服务器发送的第一请求,使服务器接收到的第一请求的发送者由合法客户端转变为非法客户端,进而骗取服务器以获取合法客户端的数据,在这种情况下,为了保护数据安全,服务器不再将第一请求进行相关的处理,并向非法客户端返回拒绝处理第一业务的第四响应。If the second processing result indicates that the client does not have the right to access the server, it indicates that the client is an illegal client, and the illegal client intercepts the first request sent by the legal client to the server to make the first request received by the server. The sender changes from a legal client to an illegal client, and then defrauds the server to obtain the data of the legal client. In this case, in order to protect the data security, the server will no longer process the first request and send the illegal client to the illegal client. The terminal returns a fourth response refusing to process the first service.
S703:根据所述第一解密结果,对所述第一业务进行处理,生成第一处理结果。S703: Process the first service according to the first decryption result to generate a first processing result.
根据所述第一密钥信息对所述第一密文进行解密,生成所述第一解密结果。Decrypt the first ciphertext according to the first key information to generate the first decryption result.
在利用第五响应对第一密文进行解密的过程中,是根据第一密钥信息对第一密文进行解密,其中,第一密钥信息为客户端对第一数据进行加密所使用的密钥信息,从而得到第一解密结果。In the process of decrypting the first ciphertext by using the fifth response, the first ciphertext is decrypted according to the first key information, wherein the first key information is used by the client to encrypt the first data key information to obtain the first decryption result.
S704:调用所述第二SDK对所述第一处理结果进行加密,生成第二密文。S704: Invoke the second SDK to encrypt the first processing result to generate a second ciphertext.
第一处理结果会返回至客户端,在服务器处理的第一业务的处理结果含有敏感信息的情况下,直接将第一处理结果返回至客户端,容易造成数据泄露的情况,从而产生各种安全威胁,例如,当第一业务为申请登录验证码的情况下,服务器对于第一业务的第一处理结果为客户端用于登录的验证码,验证码被窃取后,会导致用户的账户信息泄露,因此需要将第一处理结果进行加密。在实际应用中,使用生成第一密文的加密方式对第一处理结果进行加密,从而生成第二密文。The first processing result will be returned to the client. If the processing result of the first service processed by the server contains sensitive information, the first processing result will be directly returned to the client, which may easily lead to data leakage, resulting in various security issues. Threats, for example, when the first service is to apply for a login verification code, the server's first processing result for the first service is the verification code used by the client to log in. After the verification code is stolen, the user's account information will be leaked. , so the first processing result needs to be encrypted. In practical applications, the first processing result is encrypted by using the encryption method for generating the first ciphertext, thereby generating the second ciphertext.
S705:将所述第二密文返回至所述客户端。S705: Return the second ciphertext to the client.
在本申请实施例中,可以通过三种不同的加密方式生成第一密文,下面通过不同的实施例介绍通过第一密文在不同加密方式下的解密过程以及第一处理结果的加密过程。In the embodiments of the present application, the first ciphertext can be generated through three different encryption modes. The following describes the decryption process of the first ciphertext in different encryption modes and the encryption process of the first processing result through different embodiments.
在一实施例中,如图9所示,所述调用所述第二SDK,根据所述第一密文的加密方式,生成第一解密结果,包括:In one embodiment, as shown in FIG. 9 , the calling of the second SDK generates a first decryption result according to the encryption method of the first ciphertext, including:
S901:根据所述第一密文的加密方式,向密钥管理平台发送第五请求;所述第五请求用于请求获取解密所述第一密文的密钥信息。S901: Send a fifth request to the key management platform according to the encryption method of the first ciphertext; the fifth request is used to request to obtain key information for decrypting the first ciphertext.
由于解密过程是加密过程的逆过程,因此确定第一密文的加密方式,进而可以根据第一密文的加密方式,对第一密文进行解密,其中,用于解密第一密文的密钥信息需要通过密钥管理平台获取解密第一密文的密钥信息,服务器通过向密钥管理平台发送第五请求,使密钥管理平台能够向服务器提供第一密文的密钥信息。Since the decryption process is the inverse process of the encryption process, the encryption method of the first ciphertext is determined, and then the first ciphertext can be decrypted according to the encryption method of the first ciphertext, wherein the ciphertext used to decrypt the first ciphertext The key information needs to obtain the key information for decrypting the first ciphertext through the key management platform, and the server sends the fifth request to the key management platform, so that the key management platform can provide the server with the key information of the first ciphertext.
S902:根据所述密钥管理平台返回的关于所述第五请求的第五响应,对所述第一密文进行解密,生成所述第一解密结果。S902: Decrypt the first ciphertext according to the fifth response about the fifth request returned by the key management platform to generate the first decryption result.
服务器接收第五响应,第五响应中含有解密第一密文的密钥信息,从而服务器能够根据第五响应中的第一密文的密钥信息,对第一密文进行机密,得到第一解密结果。在实际应用中,根据第一密文的加密方式的不同,第五响应中的第一密文的密钥信息也不相同。The server receives the fifth response, and the fifth response contains the key information for decrypting the first ciphertext, so that the server can encrypt the first ciphertext according to the key information of the first ciphertext in the fifth response, and obtain the first ciphertext. decrypt the result. In practical applications, according to different encryption modes of the first ciphertext, the key information of the first ciphertext in the fifth response is also different.
在所述第一密文的加密方式为第一加密方式,所述第五响应包括所述服务器的第二私钥信息。When the encryption mode of the first ciphertext is the first encryption mode, the fifth response includes the second private key information of the server.
第一加密方式为基于RSA算法进行加密,对应的第一密文为RSA数字信封,RSA数字信封的解密首先要获取服务器的第二私钥信息,服务器的第二私钥信息是服务器通过第五请求向密钥管理平台获取,服务器得到的第五响应中含有服务器的第二私钥信息。利用服务器获取的第二私钥信息,能够解密RSA数字信封,从而获取用于加密第一数据的密钥信息,也就是客户端的第一私钥信息,进而通过第一私钥信息对加密的第一数据进行解密,获取第一数据。The first encryption method is based on the RSA algorithm, and the corresponding first ciphertext is the RSA digital envelope. To decrypt the RSA digital envelope, first obtain the second private key information of the server, and the second private key information of the server is obtained by the server through the fifth The request is obtained from the key management platform, and the fifth response obtained by the server contains the second private key information of the server. Using the second private key information obtained by the server, the RSA digital envelope can be decrypted, so as to obtain the key information used to encrypt the first data, that is, the first private key information of the client, and then use the first private key information to encrypt the encrypted first data. One data is decrypted to obtain the first data.
在所述第一密文的加密方式为第一加密方式,所述第五响应包括第三密钥信息;所述第三密钥信息为AES密钥信息。When the encryption method of the first ciphertext is the first encryption method, the fifth response includes third key information; and the third key information is AES key information.
第二加密方式为基于ECC算法进行加密,对应的第一密文为ECC数字信封,AES密钥信息为生成第一密文的过程中用于加密第一数据的密钥信息,服务器能够通过AES密钥信息对ECC数字信封进行解密,从而得到第一数据。The second encryption method is based on the ECC algorithm, the corresponding first ciphertext is an ECC digital envelope, and the AES key information is the key information used to encrypt the first data in the process of generating the first ciphertext. The key information decrypts the ECC digital envelope to obtain the first data.
调用所述第二SDK对所述第一处理结果进行加密,生成第二密文,包括:Calling the second SDK to encrypt the first processing result to generate a second ciphertext, including:
基于第一加密方式的第一加密算法或第二加密方式的第二加密算法,根据所述服务器的第二私钥信息与客户端的第二公钥信息,对所述第一处理结果进行加密,生成所述第二密文;第一加密算法为RAS算法;所述第二加密算法为椭圆曲线ECC算法。Based on the first encryption algorithm of the first encryption method or the second encryption algorithm of the second encryption method, according to the second private key information of the server and the second public key information of the client, the first processing result is encrypted, The second ciphertext is generated; the first encryption algorithm is the RAS algorithm; the second encryption algorithm is the elliptic curve ECC algorithm.
使用第一密文的加密方式对第一处理结果进行加密,生成第二密文。The first processing result is encrypted by using the encryption method of the first ciphertext to generate the second ciphertext.
第一加密方式是基于RSA算法,对第一处理结果进行加密,生成第二密文。第二密文的具体生成过程为:利用服务器的第二私钥信息对第一处理结果进行加密,从而得到关于第一处理结果的加密结果A,再利用客户端的第二公钥信通过RSA算法对服务器的第二私钥信息进行加密,得到关于服务器的第二私钥信息的加密结果B,将加密结果A与加密结果B进行组合,生成第二密文,在实际应用中,第二密文为RSA数字信封。The first encryption method is based on the RSA algorithm, and encrypts the first processing result to generate the second ciphertext. The specific generation process of the second ciphertext is as follows: encrypting the first processing result with the second private key information of the server, thereby obtaining the encryption result A about the first processing result, and then using the second public key of the client to pass the RSA algorithm Encrypt the second private key information of the server to obtain an encryption result B about the second private key information of the server, and combine the encryption result A and the encryption result B to generate a second ciphertext. The text is an RSA digital envelope.
第二加密方式是基于ECC算法,对第一处理结果进行加密,生成第二密文。第二密文的具体生成过为:根据服务器的第二私钥信息,通过椭圆曲线迪菲-赫尔曼秘钥交换(ECDH,Elliptic Curve Diffie–Hellman key Exchange)生成服务器的AES密钥,利用服务器的AES密钥对第一处理结果进行加密,从而得到关于第一处理结果的加密结果A,再利用客户端的第二公钥信息对AES密钥进行加密,得到关于服务器的AES密钥的加密结果B,将加密结果A与加密结果B进行组合,生成第二密文,在实际应用中,第二密文为ECC数字信封。The second encryption method is to encrypt the first processing result based on the ECC algorithm to generate the second ciphertext. The specific generation of the second ciphertext is as follows: according to the second private key information of the server, the AES key of the server is generated through Elliptic Curve Diffie-Hellman key exchange (ECDH, Elliptic Curve Diffie-Hellman key Exchange), and the The AES key of the server encrypts the first processing result, so as to obtain the encryption result A of the first processing result, and then uses the second public key information of the client to encrypt the AES key to obtain the encryption of the AES key of the server. For result B, the encryption result A and the encryption result B are combined to generate a second ciphertext. In practical applications, the second ciphertext is an ECC digital envelope.
在一实施例中,所述调用所述第二SDK,根据所述第一密文的加密方式,生成第一解密结果,包括:In one embodiment, the calling of the second SDK to generate a first decryption result according to the encryption method of the first ciphertext includes:
在所述加密方式为第三加密方式的情况下,所述第五响应包括第一密钥信息与第二密钥信息;所述第一密钥信息与第二密钥信息表征客户端与所述服务器之间的通信密钥信息。In the case where the encryption method is the third encryption method, the fifth response includes first key information and second key information; the first key information and second key information represent the relationship between the client and the The communication key information between the above servers.
第三加密方式是通过客户端向密钥管理平台请求分配的密钥信息进行加密,因此服务器通过第五请求向密钥管理平台请求获取密钥管理平台为客户端分配的密钥信息,服务器通过第五响应,得到第一密钥信息与第二密钥信息,可以根据第五响应中的密钥信息,对第一密文进行解密,得到第一密文的第一解密结果。The third encryption method is to encrypt the key information that the client requests to the key management platform for distribution. Therefore, the server requests the key management platform to obtain the key information distributed by the key management platform to the client through the fifth request. In the fifth response, the first key information and the second key information are obtained, and the first ciphertext can be decrypted according to the key information in the fifth response to obtain the first decryption result of the first ciphertext.
调用所述第二SDK对所述第一处理结果进行加密,生成第二密文,包括:Calling the second SDK to encrypt the first processing result to generate a second ciphertext, including:
根据所述第二密钥信息,对所述第一处理结果进行加密,生成所述第二密文。According to the second key information, the first processing result is encrypted to generate the second ciphertext.
在客户端利用第一密钥信息进行加密的情况下,服务器可以利用第二密钥信息对第一处理结果进行加密,生成第二密文。When the client uses the first key information for encryption, the server may use the second key information to encrypt the first processing result to generate the second ciphertext.
在一实施例中,所述方法还包括:In one embodiment, the method further includes:
在无法生成所述第一解密结果的情况下,向所述密钥管理平台发送第六响应;所述第六响应表征对所述第一密文解密失败。In the case that the first decryption result cannot be generated, a sixth response is sent to the key management platform; the sixth response indicates that the decryption of the first ciphertext fails.
在一般情况下,服务器接收到密钥管理平台返回的关于第五请求的第五响应中含有的密钥信息,是正确的密钥信息,能够对第一密文进行解密。当存在根据第五响应中的密钥信息无法对第一密文进行解密的情况下,服务器能够将解密失败的情况上报至密钥管理平台,使密钥管理平台对解密失败的情况进行统计和分析,从而能够有利于保证下一次解密能够顺利进行。In general, the server receives the key information contained in the fifth response about the fifth request returned by the key management platform, which is correct key information and can decrypt the first ciphertext. When the first ciphertext cannot be decrypted according to the key information in the fifth response, the server can report the decryption failure to the key management platform, so that the key management platform can count and analyze the decryption failure. Analysis, which can help to ensure that the next decryption can be carried out smoothly.
在上述实施例中,第二SDK提供了标准化的加密方式与解密方式,服务器通过调用第二SDK能够实现第一密文的解密,从而能够根据相应的业务数据处理第一业务,并将处理结果进行加密后返回客户端,提高了客户端与服务器之间的传输数据的安全性,并且还能提高了对传输数据的加密效率以及解密效率。In the above embodiment, the second SDK provides a standardized encryption method and decryption method, and the server can decrypt the first ciphertext by calling the second SDK, so that the first service can be processed according to the corresponding service data, and the processing result can be processed. After encryption, the data is returned to the client, which improves the security of data transmission between the client and the server, and also improves the encryption efficiency and decryption efficiency of the transmission data.
本申请实施例还提供了另一种数据传输方法,如图10所示,应用于密钥管理平台,所述方法包括:The embodiment of the present application also provides another data transmission method, as shown in FIG. 10, which is applied to a key management platform, and the method includes:
S1001:接收客户端或服务器发送的密钥管理请求。S1001: Receive a key management request sent by a client or a server.
密钥管理平台能够接收客户端或服务器发送的密钥管理请求,其中,客户端发送的密钥管理请求通常为请求进行密钥登记、分配密钥信息以及获取服务器的业务证书。服务器发送的密钥管理请求通常为请求进行密钥协商。在实际应用中,密钥管理平台能够支持不同的密钥管理服务以及支持调用各种密钥管理工具,例如,KMS工具、PKI工具等,进而完成客户端或服务器发送的密钥管理请求所请求的密钥服务。The key management platform can receive the key management request sent by the client or the server, wherein the key management request sent by the client is usually a request for key registration, distribution of key information, and acquisition of the server's service certificate. The key management request sent by the server is usually a request for key negotiation. In practical applications, the key management platform can support different key management services and call various key management tools, such as KMS tools, PKI tools, etc., and then complete the key management request sent by the client or server. key service.
S1002:根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应。S1002: According to the key management request, call a key service corresponding to the request to generate a response to the key management request.
密钥管理平台根据密钥管理请求,从而确定密钥管理请求需要的密钥服务,例如,密钥管理请求为密钥登记的情况下,调用密钥登记服务进行密钥的登记。当密钥管理平台调用相应的密钥服务完成密钥管理请求所请求的密钥服务器的情况下,会生成关于密钥管理请求的响应,例如,调用密钥登记服务完成密钥的登记,能够生成密钥登记成功的响应信息。The key management platform determines the key service required by the key management request according to the key management request. For example, if the key management request is key registration, the key registration service is invoked to register the key. When the key management platform calls the corresponding key service to complete the key server requested by the key management request, it will generate a response to the key management request. For example, calling the key registration service to complete the key registration can Generate a response message that the key registration is successful.
在一实施例中,所述根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应,包括:In an embodiment, according to the key management request, invoking a key service corresponding to the request to generate a response to the key management request includes:
在所述密钥管理请求为第二请求的情况下,调用第一密钥服务和第一工具,生成关于所述第二请求的第一响应;所述第一响应包括第一密钥信息与第二密钥信息;所述第一密钥服务表征密钥协商服务;所述第二请求用于请求分配所述客户端与所述服务器之间的通信密钥信息。In the case that the key management request is a second request, the first key service and the first tool are invoked to generate a first response to the second request; the first response includes the first key information and the second key information; the first key service represents a key agreement service; the second request is used for requesting distribution of communication key information between the client and the server.
密钥管理平台接收到第二请求,第二请求为客户端发起的请求,客户端发起的第二请求用于请求密钥管理平台分配客户端与服务器之间的通信密钥信息,使客户端与服务器通过密钥管理平台分配的通信密钥信息进行数据的传输。The key management platform receives the second request, the second request is a request initiated by the client, and the second request initiated by the client is used to request the key management platform to allocate the communication key information between the client and the server, so that the client Data is transmitted with the server through the communication key information distributed by the key management platform.
密钥管理平台接收到的密钥管理请求为第二请求的情况下,需要调用第一密钥服务,通过第一密钥服务,进行密钥协商,从而生成客户端与服务器之间的通信密钥信息。When the key management request received by the key management platform is the second request, the first key service needs to be called, and key negotiation is performed through the first key service, thereby generating a communication key between the client and the server. key information.
第一响应的生成过程具体为:密钥管理平台接收到第二请求,其中,第二请求中还携带了第一缓存数据buffer1,密钥管理平台调用第一密钥服务请求进行密钥协商,通过第一工具KMS工具,解密得到第一密钥信息,并通过调用密钥分发服务能够分配得到第二密钥信息,在实际应用中,客户端可以根据第一密钥信息实现对客户端的数据进行加密,从而服务器能够根据第一密钥信息实现对客户端加密的数据进行解密,服务器能够根据第二密钥信息实现对服务器的数据进行加密,从而客户端也能够根据第二密钥信息实现对服务器加密的数据进行解密。The generation process of the first response is specifically as follows: the key management platform receives a second request, wherein the second request also carries the first cached data buffer1, and the key management platform invokes the first key service request to perform key negotiation, Through the first tool KMS tool, the first key information is obtained by decryption, and the second key information can be distributed by invoking the key distribution service. Encryption, so that the server can decrypt the data encrypted by the client according to the first key information, and the server can encrypt the data of the server according to the second key information, so that the client can also realize according to the second key information. Decrypt data encrypted by the server.
在实际应用中,直接将第一密钥信息与第二密钥信息返回至客户端容易导致信息的泄露,因此需要对第一密钥信息与第二密钥信息进行加密。第一密钥服务通过两次轮转更新,负责解密第一缓存数据buffer1,并负责对第一密钥信息与第二密钥信息进行加密,其中,第一密钥信息与第二密钥信息通过AES密钥进行加密,从而派生得到经过AES密钥加密的第一密钥信息C1与第二密钥信息C2,只需要对经过AES密钥加密的第一密钥信息与第二密钥信息进行加密保护,即使在传输的过程中泄漏了AES密钥的明文,也不会影响第一密钥信息与第二密钥信息的安全性。第一密钥服务能够对第一密钥信息C1与第二密钥信息C2进行保存,并将第二缓存数据buffer2返回至客户端,其中,第二缓存数据buffer2中含有第一密钥信息与第二密钥信息。In practical applications, directly returning the first key information and the second key information to the client may easily lead to information leakage, so the first key information and the second key information need to be encrypted. The first key service is updated through two rotations, and is responsible for decrypting the first cached data buffer1, and is responsible for encrypting the first key information and the second key information, wherein the first key information and the second key information pass through The AES key is encrypted to derive the first key information C1 and the second key information C2 encrypted by the AES key, and only the first key information and the second key information encrypted by the AES key need to be processed. Encryption protection, even if the plaintext of the AES key is leaked during transmission, it will not affect the security of the first key information and the second key information. The first key service can save the first key information C1 and the second key information C2, and return the second cached data buffer2 to the client, wherein the second cached data buffer2 contains the first key information and second key information.
在一实施例中,如图11所示,所述根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应,包括:In one embodiment, as shown in FIG. 11 , according to the key management request, invoking a key service corresponding to the request to generate a response to the key management request includes:
S1101:在所述密钥管理请求为第三请求的情况下,调用第二密钥服务,确定第三处理结果;所述第三处理结果表征对所述客户端进行鉴权的结果;所述第二密钥服务表征鉴权服务。S1101: In the case that the key management request is a third request, call a second key service to determine a third processing result; the third processing result represents a result of authenticating the client; the The second key service represents the authentication service.
第三请求为客户端发起的请求,用于请求密钥管理平台对密钥信息进行登记。当密钥管理平台接收到第三请求的情况下,调用第二密钥服务对客户端进行鉴权,得到第三处理结果,通过第三处理结果能够确定客户端是否为合法客户端,从而避免密钥管理平台登记非法客户端的密钥信息,避免非法客户端与服务器进行通信。The third request is a request initiated by the client, and is used to request the key management platform to register the key information. When the key management platform receives the third request, it calls the second key service to authenticate the client, and obtains the third processing result. Through the third processing result, it can be determined whether the client is a legitimate client, so as to avoid The key management platform registers the key information of illegal clients to prevent illegal clients from communicating with the server.
S1102:在所述第三处理结果表征允许所述客户端访问所述密钥管理平台的情况下,调用第三密钥服务对客户端的第二公钥信息进行登记,生成第二响应;所述第二响应表征所述第二公钥信息登记成功;所述第三密钥服务表征密钥登记服务。S1102: In the case that the third processing result indicates that the client is allowed to access the key management platform, call a third key service to register the second public key information of the client, and generate a second response; the The second response indicates that the registration of the second public key information is successful; the third key service indicates the key registration service.
在第三处理结果表征允许客户端访问密钥管理平台的情况下,表明客户端为合法客户端,从而进行客户端的第二公钥信息的登记。密钥管理平台通过调用第三密钥服务对客户端的第二公钥信息进行登记,生成关于第三请求的第二响应,当密钥管理平台成功登记第二公钥信息的情况下,能够生成表征密钥登记成功的第二响应,登记成功的第二公钥信息是通过密钥采集服务,将第二公钥信息写入到密钥管理平台的数据库中。当密钥管理平台没能登记第二公钥信息的情况下,生成表征密钥登记失败的第二响应。In the case that the third processing result indicates that the client is allowed to access the key management platform, it indicates that the client is a legitimate client, so that the registration of the second public key information of the client is performed. The key management platform registers the second public key information of the client by invoking the third key service, and generates a second response to the third request. When the key management platform successfully registers the second public key information, it can generate The second response representing the successful registration of the key, the second public key information of the successful registration is to write the second public key information into the database of the key management platform through the key collection service. When the key management platform fails to register the second public key information, a second response representing the failure of the key registration is generated.
在实际应用中,第三请求携带的第二公钥信息是经过加密的,也就是说第二密钥信息装载在数字信封中,在这种情况下,首先对数字信封进行解密,从而获取第二公钥信息,再对第二公钥信息进行登记。具体地,密钥管理平台调用第一密钥服务,对数字信封进行拆解,从而获得AES密钥信息,其中,AES密钥信息是用于加密第二公钥信息的密钥信息,通过AES密钥信息对加密的第二公钥信息进行解密,得到第二公钥信息,再对第二公钥信息进行登记。In practical applications, the second public key information carried in the third request is encrypted, that is to say, the second key information is loaded in the digital envelope. In this case, the digital envelope is first decrypted to obtain the first key information. Second public key information, and then register the second public key information. Specifically, the key management platform invokes the first key service to disassemble the digital envelope to obtain AES key information, where the AES key information is the key information used to encrypt the second public key information, and the AES key information is used to encrypt the second public key information. The key information decrypts the encrypted second public key information to obtain the second public key information, and then registers the second public key information.
在一实施例中,所述根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应,包括:In an embodiment, according to the key management request, invoking a key service corresponding to the request to generate a response to the key management request includes:
在所述密钥管理请求为第四请求的情况下,调用第三密钥服务,生成第三响应;所述第三密钥服务表征所述第三密钥服务表征密钥登记服务;所述第三响应表征最新版本的业务证书。In the case that the key management request is a fourth request, a third key service is called to generate a third response; the third key service represents the third key service and the key registration service; the The third response represents the latest version of the service certificate.
第四请求为客户端发起的请求,用于请求密钥管理平台向客户端返回最新版本的业务证书,其中,业务证书是服务器的数字证书,是一个经证书授权中心数字签名的文件,最简单的业务证书中含有服务器的第一公钥信息、服务器的名称以及证书授权中心的数字签名,一般情况下,业务证书中还包括服务器的第一公钥信息的有效时间、发证机关的名称、业务证书的序列号等不同的信息,客户端通过获取从最新版本的业务证书中获取服务器的第一公钥信息,进而完成数据的加密。The fourth request is a request initiated by the client, and is used to request the key management platform to return the latest version of the business certificate to the client, where the business certificate is the server's digital certificate, which is a file digitally signed by the certificate authority. The business certificate contains the first public key information of the server, the name of the server and the digital signature of the certificate authority. In general, the business certificate also includes the valid time of the first public key information of the server, the name of the issuing authority, For different information such as the serial number of the service certificate, the client obtains the first public key information of the server from the latest version of the service certificate, and then completes data encryption.
当密钥管理平台接收到第四请求的情况下,调用第三密钥管理服务,在密钥管理平台的数据库中查询最新版本的业务证书,并生成关于第四请求的第三响应,其中,第三相应为最新版本的业务证书。When the key management platform receives the fourth request, the third key management service is invoked, the latest version of the service certificate is queried in the database of the key management platform, and a third response to the fourth request is generated, wherein, The third correspondence is the latest version of the business certificate.
在一实施例中,如图12所示,所述根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应,包括:In one embodiment, as shown in FIG. 12 , according to the key management request, invoking a key service corresponding to the request, and generating a response to the key management request, includes:
S1201:在所述密钥管理请求为第五请求的情况下,调用第一密钥服务;所述第五请求用于请求获取解密所述第一密文的密钥信息;所述第一密钥服务表征密钥协商服务。S1201: When the key management request is a fifth request, call a first key service; the fifth request is used to request to obtain key information for decrypting the first ciphertext; the first ciphertext The key service represents the key agreement service.
第五请求为服务器发起的请求,用于请求密钥管理平台获取解密第一密文的密钥信息,其中,解密第一密文的密钥信息是通过第一密钥服务,进行密钥协商得到的。The fifth request is a request initiated by the server, and is used to request the key management platform to obtain key information for decrypting the first ciphertext, wherein the key information for decrypting the first ciphertext is to perform key negotiation through the first key service owned.
S1202:根据所述第一密文的加密方式,生成第五响应;所述第五响应包括解密所述第一密文的密钥信息。S1202: Generate a fifth response according to the encryption method of the first ciphertext; the fifth response includes key information for decrypting the first ciphertext.
解密过程实质上为加密过程的逆过程,不同的加密方式会导致解密的密钥信息以及解密方式不相同,因此,密钥管理平台在调用密钥协商服务的过程中,会根据第一密文的加密方式,协商得到解密第一密文的密钥信息,从而根据第五响应,将解密第一密文的密钥信息返回至服务器,以使服务器根据第五响应中的密钥信息进行解密。The decryption process is essentially the reverse process of the encryption process. Different encryption methods will result in different decrypted key information and decryption methods. Therefore, when the key management platform invokes the key negotiation service, it will the encryption method, negotiate to obtain the key information for decrypting the first ciphertext, so that according to the fifth response, the key information for decrypting the first ciphertext is returned to the server, so that the server can decrypt according to the key information in the fifth response. .
在一实施例中,所述根据所述第一密文的加密方式,生成第五响应,包括:In an embodiment, the generating a fifth response according to the encryption method of the first ciphertext, including:
在所述第一密文的加密方式为第一加密方式的情况下,调用第一工具,获取所述服务器的第一私钥信息。When the encryption mode of the first ciphertext is the first encryption mode, the first tool is invoked to obtain the first private key information of the server.
第一加密方式表征利用RSA算法对第一数据进行加密,得到的第一密文为RSA数字信封,第一密文的解密步骤为先解密RSA数字信封,再对加密的第一数据进行解密。密钥协商服务能够从第一工具KMS工具中获取用于解密RSA的数字信封的密钥信息,也就是服务器的第二私钥信息,通过第五响应将服务器的第二私钥信息返回至服务器。The first encryption method represents that the RSA algorithm is used to encrypt the first data, and the obtained first ciphertext is an RSA digital envelope, and the decryption step of the first ciphertext is to decrypt the RSA digital envelope first, and then decrypt the encrypted first data. The key agreement service can obtain the key information for decrypting the RSA digital envelope from the first tool KMS tool, that is, the server's second private key information, and returns the server's second private key information to the server through the fifth response .
在所述第一密文的加密方式为第二加密方式的情况下,调用第一工具,获取所述第三密钥信息;所述第三密钥信息表征AES密钥信息。When the encryption mode of the first ciphertext is the second encryption mode, the first tool is invoked to obtain the third key information; the third key information represents the AES key information.
第二加密方式表征利用ECC算法对第一数据进行加密,得到的第一密文为ECC数字信封,要获取第一数据,首先要对ECC数字信封进行解密,再对加密的第一数据进行解密。密钥协商服务能够从第一工具KMS工具中获取服务器的第二私钥信息,并且根据服务器的第二私钥信息确定AES密钥信息,AES密钥信息为加密第一数据的密钥信息,通过第五响应将AES密钥信息返回至服务器。The second encryption method represents that the first data is encrypted by the ECC algorithm, and the obtained first ciphertext is the ECC digital envelope. To obtain the first data, the ECC digital envelope must be decrypted first, and then the encrypted first data must be decrypted. . The key agreement service can obtain the second private key information of the server from the first tool KMS tool, and determine the AES key information according to the second private key information of the server, where the AES key information is the key information for encrypting the first data, The AES key information is returned to the server through the fifth response.
所述第一密文的加密方式为第三方式的情况下,根据第一标记,获取第一密钥信息与第二密钥信息;所述第一标记表征所述第一密钥服务历史协商所述服务器与所述客户端之间的密钥信息。When the encryption mode of the first ciphertext is the third mode, the first key information and the second key information are obtained according to the first mark; the first mark represents the historical negotiation of the first key service Key information between the server and the client.
第三加密方式为通过密钥管理平台分配的客户端与服务器之间的通信密钥信息对第一数据进行加密,对第一密文进行解密需要先获取客户端与服务器之间的通信密钥信息,由于密钥管理平台在确定客户端与服务器之间的通信密钥信息的过程中,将客户端与服务器之间的通信密钥信息存储至密钥协商服务中,因此可以通过第一标记从密钥协商服务中获取对应的第一密钥信息与第二密钥信息,第一标记可以用于区分不同客户端与服务器的通信密钥信息,从而能够从密钥协商服务存储的密钥信息中提取到对应的第一密钥信息与第二密钥信息。The third encryption method is to encrypt the first data through the communication key information between the client and the server distributed by the key management platform. To decrypt the first ciphertext, the communication key between the client and the server needs to be obtained first. information, since the key management platform stores the communication key information between the client and the server in the key agreement service in the process of determining the communication key information between the client and the server, it can pass the first mark Obtain the corresponding first key information and second key information from the key agreement service, and the first mark can be used to distinguish the communication key information between different clients and servers, so that the key information stored in the key agreement service can be obtained from the key agreement service. Corresponding first key information and second key information are extracted from the information.
在一实施例中,所述方法还包括:In one embodiment, the method further includes:
在无法获取解密所述第一密文的密钥信息的情况下,生成第七响应;所述第七响应表征协商密钥信息失败。In the case that the key information for decrypting the first ciphertext cannot be obtained, a seventh response is generated; the seventh response represents a failure to negotiate the key information.
密钥管理平台是通过密钥协商服务,确定用于解密第一密文的密钥信息。当密钥协商服务无法协商确定用于解密第一密文的密钥信息的情况下,服务器无法对第一密文进行解密,也就是说密钥管理平台存在错误报告,将无法获取解密第一密文的密钥信息的情况下产生的第七响应进行上报,从而能够统计密钥管理平台协商失败的次数,进而能够进一步分析得到密钥协商失败的原因,能够保证密钥协商成功的几率。The key management platform determines the key information for decrypting the first ciphertext through the key agreement service. When the key negotiation service cannot negotiate and determine the key information for decrypting the first ciphertext, the server cannot decrypt the first ciphertext, that is to say, the key management platform has an error report and cannot obtain the decryption first ciphertext. The seventh response generated in the case of the key information of the ciphertext is reported, so that the number of times that the key management platform fails to negotiate can be counted, and then the reason for the failure of the key negotiation can be further analyzed, and the probability of successful key negotiation can be guaranteed.
在实际应用中,由于第三加密方式是通过密钥管理平台分配的通信密钥信息进行加密的,因而针对第三加密方式不存在协商失败的情况,而第一加密方式与第二加密方式均需要密钥管理平台协商得到服务器的第二私钥信息,从而存在协商失败的情况,因此,在获取第一加密方式或第二加密方式对应的解密密钥信息的情况下,需要监控密钥协商是否成功,在获取第三加密方式对应的解密密钥信息的情况下,不需要监控密钥协商是否成功。In practical applications, since the third encryption method is encrypted by the communication key information distributed by the key management platform, there is no negotiation failure for the third encryption method, and the first encryption method and the second encryption method are both encrypted. The key management platform needs to negotiate to obtain the second private key information of the server, so the negotiation fails. Therefore, in the case of obtaining the decryption key information corresponding to the first encryption method or the second encryption method, it is necessary to monitor the key negotiation. Whether it is successful or not, in the case of obtaining the decryption key information corresponding to the third encryption method, it is not necessary to monitor whether the key negotiation is successful.
S1003:将关于所述密钥管理请求的响应返回至所述客户端或服务器。S1003: Return a response to the key management request to the client or server.
密钥管理平台将关于密钥管理请求的响应返回至客户端或服务器,在实际应用中,当关于密钥管理请求的响应中存在安全需求高的数据的情况下,可以对数据进行加密后再返回至客户端或服务器,从而使客户端或服务器能够接收到关于密钥管理请求的处理结果。The key management platform returns the response to the key management request to the client or server. In practical applications, when there is data with high security requirements in the response to the key management request, the data can be encrypted before Return to the client or server, so that the client or server can receive the processing result of the key management request.
在上述实施例中,密钥管理平台通过服务器或客户端发起的密钥管理平台,调用相应的密钥管理服务器完成不同密钥需求对应的密钥管理服务,从而能够通过不同的接口,提供一套标准化的密钥管理服务的处理流程,提高了密钥管理的效率,并且还能够提高密钥管理平台所管理的密钥信息的安全性。In the above embodiment, the key management platform invokes the corresponding key management server to complete the key management service corresponding to different key requirements through the key management platform initiated by the server or the client, so as to provide a key management service through different interfaces. A standardized set of processing procedures for key management services improves the efficiency of key management and also improves the security of key information managed by the key management platform.
本申请还提供了一应用实施例,如图13所示,图13示出了密钥管理技术架构对RSA数字信封的处理流程示意图。The present application also provides an application embodiment, as shown in FIG. 13 , which shows a schematic diagram of the processing flow of the RSA digital envelope by the key management technology architecture.
客户端向第一SDK发送加密请求,用于请求第一SDK对第一数据进行加密。第一SDK通过第一加密方式对第一数据进行加密,生成第一密文,第一密文为RSA数字信封。The client sends an encryption request to the first SDK for requesting the first SDK to encrypt the first data. The first SDK encrypts the first data by using the first encryption method to generate a first ciphertext, and the first ciphertext is an RSA digital envelope.
客户端向服务器发送第一请求,用于请求服务器协助进行第一业务的处理,其中,第一请求中携带有第一密文。The client sends a first request to the server for requesting the server to assist in processing the first service, wherein the first request carries the first ciphertext.
服务器接收到第一请求后,请求第二SDK解密第一密文。第二SDK通过向密钥管理平台发送第五请求,用于请求获取解密第一密文的密钥信息。After receiving the first request, the server requests the second SDK to decrypt the first ciphertext. By sending the fifth request to the key management platform, the second SDK is used to request to obtain the key information for decrypting the first ciphertext.
密钥管理平台接收到第五请求后,密钥协商应用服务调用领域层的业务鉴权能力,对客户端进行鉴权,其中,当进行的是非证书类的简单鉴权,可以集成在第二SDK中。业务鉴权能力得到客户端的鉴权结果后,将鉴权结果返回至密钥协商应用服务。密钥协商应用服务请求密钥协商领域服务进行密钥协商,密钥协商领域服务从KMS中获取服务器的第二私钥信息,并逐层返回至第二SDK。其中,当密钥协商领域服务不能从KMS中获取服务器的第二私钥信息的情况下,向数据统计上报协商失败信息。After the key management platform receives the fifth request, the key agreement application service invokes the service authentication capability of the domain layer to authenticate the client. in the SDK. After the service authentication capability obtains the authentication result of the client, the authentication result is returned to the key agreement application service. The key agreement application service requests the key agreement domain service to perform key negotiation, and the key agreement domain service obtains the server's second private key information from the KMS, and returns to the second SDK layer by layer. Wherein, when the key negotiation domain service cannot obtain the server's second private key information from the KMS, the negotiation failure information is reported to the data statistics.
第二SDK获得服务器的第二私钥信息后,对第一密文进行解密,得到第一密文的解密结果,并将第一密文的解密结果返回至服务器。After obtaining the second private key information of the server, the second SDK decrypts the first ciphertext, obtains the decryption result of the first ciphertext, and returns the decryption result of the first ciphertext to the server.
服务器根据第一密文的解密结果处理业务逻辑,并调用第二SDK对处理结果进行加密,并将第二密文返回至客户端。The server processes the business logic according to the decryption result of the first ciphertext, calls the second SDK to encrypt the processing result, and returns the second ciphertext to the client.
客户端接收第二密文后,调用第一SDK对第二密文进行解密,第一SDK将第二密文解密得到的第一明文返回至客户端,客户端根据第一明文,处理业务逻辑。After the client receives the second ciphertext, it calls the first SDK to decrypt the second ciphertext, the first SDK returns the first plaintext obtained by decrypting the second ciphertext to the client, and the client processes the business logic according to the first plaintext .
本申请还提供了另一应用实施例,如图14所示,图14示出了密钥管理技术架构对ECC数字信封的处理流程示意图。The present application also provides another application embodiment, as shown in FIG. 14 , which shows a schematic diagram of the processing flow of the ECC digital envelope by the key management technology architecture.
客户端向第一SDK发送加密请求,用于请求第一SDK对第一数据进行加密。第一SDK通过第二加密方式对第一数据进行加密,生成第一密文,第一密文为ECC数字信封。The client sends an encryption request to the first SDK for requesting the first SDK to encrypt the first data. The first SDK encrypts the first data through the second encryption method to generate a first ciphertext, and the first ciphertext is an ECC digital envelope.
客户端向服务器发送第一请求,用于请求服务器协助进行第一业务的处理,其中,第一请求中携带有第一密文。The client sends a first request to the server for requesting the server to assist in processing the first service, wherein the first request carries the first ciphertext.
服务器接收到第一请求后,请求第二SDK解密第一密文。第二SDK通过向密钥管理平台发送第五请求,用于请求获取解密第一密文的密钥信息。After receiving the first request, the server requests the second SDK to decrypt the first ciphertext. By sending the fifth request to the key management platform, the second SDK is used to request to obtain the key information for decrypting the first ciphertext.
密钥管理平台接收到第五请求后,密钥协商应用服务调用领域层的业务鉴权能力,对客户端进行鉴权,其中,当进行的是非证书类的简单鉴权,可以集成在第二SDK中。业务鉴权能力得到客户端的鉴权结果后,将鉴权结果返回至密钥协商应用服务。密钥协商应用服务请求密钥协商领域服务进行密钥协商,密钥协商领域服务从KMS中获取服务器的第二私钥信息,并根据第二私钥信息使用ECDH计算得到AES密钥,并将AES密钥逐层返回至第二SDK。其中,当密钥协商领域服务不能从KMS中获取AES密钥的情况下,向数据统计上报协商失败信息。After the key management platform receives the fifth request, the key agreement application service invokes the service authentication capability of the domain layer to authenticate the client. in the SDK. After the service authentication capability obtains the authentication result of the client, the authentication result is returned to the key agreement application service. The key agreement application service requests the key agreement domain service to perform key negotiation. The key agreement domain service obtains the server's second private key information from the KMS, uses ECDH to calculate the AES key according to the second private key information, and uses The AES key is returned to the second SDK layer by layer. Among them, when the key negotiation domain service cannot obtain the AES key from the KMS, the negotiation failure information is reported to the data statistics.
第二SDK获得AES密钥后,对第一密文进行解密,得到第一密文的解密结果,并将第一密文的解密结果返回至服务器。After obtaining the AES key, the second SDK decrypts the first ciphertext, obtains the decryption result of the first ciphertext, and returns the decryption result of the first ciphertext to the server.
服务器根据第一密文的解密结果处理业务逻辑,并调用第二SDK对处理结果进行加密,并将第二密文返回至客户端。The server processes the business logic according to the decryption result of the first ciphertext, calls the second SDK to encrypt the processing result, and returns the second ciphertext to the client.
客户端接收第二密文后,调用第一SDK对第二密文进行解密,第一SDK将第二密文解密得到的第一明文返回至客户端,客户端根据第一明文,处理业务逻辑。After the client receives the second ciphertext, it calls the first SDK to decrypt the second ciphertext, the first SDK returns the first plaintext obtained by decrypting the second ciphertext to the client, and the client processes the business logic according to the first plaintext .
本申请还提供了另一应用实施例,如图15所示,图15示出了密钥管理技术架构对基于客户端与服务器之间的通信密钥加密的第一密文的处理流程示意图。The present application also provides another application embodiment, as shown in FIG. 15 , which shows a schematic flowchart of processing the first ciphertext encrypted based on the communication key between the client and the server by the key management technology framework.
客户端向第一SDK发送加密请求,用于请求第一SDK对第一数据进行加密。第一SDK初始化生成临时公钥信息与私钥信息,调用initialize函数初始化HS,调用write_message函数更新HS,并生成第一缓存数据buffer1,将第一缓存数据buffer1传输给密钥管理平台,其中,第一缓存数据buffer1中含有临时公钥信息、签名等信息。The client sends an encryption request to the first SDK for requesting the first SDK to encrypt the first data. The first SDK initializes and generates temporary public key information and private key information, calls the initialize function to initialize the HS, calls the write_message function to update the HS, generates the first cached data buffer1, and transmits the first cached data buffer1 to the key management platform. A cached data buffer1 contains temporary public key information, signature and other information.
密钥管理平台在接收到第一缓存数据buffer1后,调用密钥协商应用服务,密钥协商应用服务请求密钥协商领域服务器进行密钥协商,密钥协商领域服务通过KMS获取业务私钥,并调用密钥分发服务获取应用公钥,密钥协商领域服务根据业务私钥与应用公钥,生成临时公钥信息与私钥信息,通过两次轮转更新HS,并解密第一缓存数据buffer1,派生得到AES密钥信息,包括第一密钥信息与第二密钥信息,密钥协商领域服务将第二缓存数据buffer2、临时公钥信息、第一密钥信息与第二密钥信息返回至密钥协商应用服务,密钥协商应用服务保持第一密钥信息与第二密钥信息,并将第二缓存数据buffer2、第一密钥信息与第二密钥信息返回至客户端。After receiving the first cached data buffer1, the key management platform calls the key agreement application service, the key agreement application service requests the key agreement domain server to perform key negotiation, and the key agreement domain service obtains the service private key through the KMS, and Call the key distribution service to obtain the application public key, and the key agreement domain service generates temporary public key information and private key information according to the business private key and the application public key, updates the HS through two rotations, and decrypts the first cached data buffer1, and derives the Obtain the AES key information, including the first key information and the second key information, and the key negotiation domain service returns the second cached data buffer2, temporary public key information, first key information and second key information to the secret key. The key agreement application service maintains the first key information and the second key information, and returns the second cache data buffer2, the first key information and the second key information to the client.
第一SDK调用write_message函数更新HS,并解密第二缓存数据buffer2,得到第一密钥信息与第二密钥信息。使用第一密钥信息加密第一数据得到第一密文。将第一密文返回至客户端。The first SDK calls the write_message function to update the HS, and decrypts the second cached data buffer2 to obtain the first key information and the second key information. The first ciphertext is obtained by encrypting the first data using the first key information. Return the first ciphertext to the client.
客户端向服务器发送第一请求,用于请求服务器协助进行第一业务的处理,其中,第一请求中携带有第一密文。The client sends a first request to the server for requesting the server to assist in processing the first service, wherein the first request carries the first ciphertext.
服务器接收到第一请求后,请求第二SDK解密第一密文。第二SDK通过向密钥管理平台发送第五请求,用于请求获取解密第一密文的密钥信息。After receiving the first request, the server requests the second SDK to decrypt the first ciphertext. By sending the fifth request to the key management platform, the second SDK is used to request to obtain the key information for decrypting the first ciphertext.
密钥管理平台接收到第五请求后,通过密钥协商应用服务,通过相应的第一标记,得到第一密钥信息与第二密钥信息,将第一密钥信息与第二密钥信息返回至服务器。After receiving the fifth request, the key management platform obtains the first key information and the second key information through the key negotiation application service, and through the corresponding first mark, and combines the first key information and the second key information Return to the server.
调用第二SDK利用第一密钥信息对第一密文进行解密,将第一密文的解密结果返回至服务器。The second SDK is called to decrypt the first ciphertext by using the first key information, and the decryption result of the first ciphertext is returned to the server.
服务器根据第一密文的解密结果,处理业务逻辑,并调用第二SDK对第一处理结果进行加密。The server processes the business logic according to the decryption result of the first ciphertext, and calls the second SDK to encrypt the first processing result.
第二SDK通过第二密钥信息对第一处理结果进行加密,生成第二密文。服务器将第二密文返回至客户端。The second SDK encrypts the first processing result by using the second key information to generate the second ciphertext. The server returns the second ciphertext to the client.
客户端调用第一SDK,根据第二密钥信息,解密第二密文,得到第一明文,并根据第一明文处理业务逻辑。The client calls the first SDK, decrypts the second ciphertext according to the second key information, obtains the first plaintext, and processes the business logic according to the first plaintext.
本申请还提供了另一应用实施例,如图16所示,图16示出了密钥管理技术架构登记密钥的处理流程。The present application also provides another application embodiment, as shown in FIG. 16 , which shows a process flow of registering a key in a key management technology framework.
客户端初始化第一SDK,第一SDK生成公钥信息与私钥信息,并将公钥信息与私钥信息进行保存。客户端向密钥管理平台发起第三请求,第三请求中携带有公钥信息。The client initializes the first SDK, the first SDK generates public key information and private key information, and stores the public key information and the private key information. The client initiates a third request to the key management platform, and the third request carries public key information.
密钥管理平台根据第三请求,调用密钥登记应用服务,如果公钥信息经过数字信封进行加密,密钥登记应用服务请求密钥协商领域服务拆解数字信封,密钥领域协商服务拆解数字信封后得到AES密钥,将AES密钥返回至密钥登记应用服务,密钥登记应用服务根据AES密钥解密得到公钥信息,并调用业务鉴权能力,对客户端进行鉴权,并将鉴权结果返回至密钥登记应用服务,在鉴权结果表征客户端为合法客户端的情况下,密钥登记应用服务将公钥信息发送给密钥采集服务,密钥采集服务将公钥信息存储至数据库中,并逐层返回响应。The key management platform calls the key registration application service according to the third request. If the public key information is encrypted by the digital envelope, the key registration application service requests the key agreement domain service to disassemble the digital envelope, and the key domain agreement service disassembles the digital envelope. After the envelope, the AES key is obtained, and the AES key is returned to the key registration application service. The key registration application service obtains the public key information according to the AES key decryption, and invokes the service authentication capability to authenticate the client. The authentication result is returned to the key registration application service. If the authentication result indicates that the client is a legitimate client, the key registration application service sends the public key information to the key collection service, and the key collection service stores the public key information. into the database and return the response layer by layer.
客户端能够接收表征登记成功的响应。The client can receive a response indicating that the registration was successful.
本申请还提供了另一应用实施例,如图17所示,图17示出了密钥管理技术架构的业务证书升级的处理流程。The present application also provides another application embodiment, as shown in FIG. 17 , which shows the processing flow of the service certificate upgrade of the key management technology architecture.
客户端初始化第一SDK,并调用第一SDK向密钥管理平台发送第四请求,第四请求用于请求密钥管理平台检测业务证书的更新。The client initializes the first SDK, and calls the first SDK to send a fourth request to the key management platform, where the fourth request is used to request the key management platform to detect the update of the service certificate.
密钥管理平台根据第四请求,调用密钥登记应用服务,密钥登记应用服务向密钥分发领域服务获取最新版本的业务证书,密钥分发领域服务在数据库中将查询到的最新版本的业务证书逐层返回至客户端,客户端能够获取最新版本的业务证书。The key management platform invokes the key registration application service according to the fourth request, the key registration application service obtains the latest version of the business certificate from the key distribution domain service, and the key distribution domain service will query the database for the latest version of the service The certificate is returned to the client layer by layer, and the client can obtain the latest version of the service certificate.
本申请还提供了另一应用实施例,如图18所示,图18示出了密钥申请业务接入流程。The present application also provides another application embodiment, as shown in FIG. 18 , which shows the key application service access process.
业务方提交创建证书的申请,管理后台根据请求创建对应的证书,并将证书送审。审批人员对证书进行第一次审批,再由平台对证书进行第二次审批,根据第二次的审批结果,业务方进行接入SDK的调试,并根据调试结果配置网关转发规则。此外,平台根据第二次的审批结果进行业务量的评估,并通知平台准备相关业务的上线,部署对应的资源。The business party submits an application for creating a certificate, and the management background creates a corresponding certificate according to the request, and submits the certificate for review. The approving staff conducts the first approval of the certificate, and then the platform conducts the second approval for the certificate. According to the second approval result, the business side debugs the access to the SDK, and configures the gateway forwarding rules according to the debugging result. In addition, the platform evaluates the business volume according to the second approval result, and informs the platform to prepare for the launch of relevant business and deploy the corresponding resources.
本申请实施例还提供了数据传输装置,如图19所述,应用于客户端,包括:The embodiment of the present application also provides a data transmission device, as shown in FIG. 19, applied to a client, including:
第一加密单元1901,用于调用第一软件开发工具包SDK,基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文;The first encryption unit 1901 is used to call the first software development kit SDK, and based on at least one encryption method supported by the first SDK, encrypt the first data about the first service, and generate the first ciphertext;
第一发送单元1902,用于向服务器发送第一请求;所述第一请求中携带所述第一密文;所述第一请求用于请求处理所述第一业务;a first sending unit 1902, configured to send a first request to a server; the first request carries the first ciphertext; the first request is used to request processing of the first service;
第一接收单元1903,用于接收所述服务器基于所述第一请求返回的第二密文;所述第二密文由所述服务器基于所述第一请求对所述第一密文的第一处理结果进行加密得到;The first receiving unit 1903 is configured to receive the second ciphertext returned by the server based on the first request; 1. The processing result is encrypted and obtained;
第一解密单元1904,用于调用所述第一SDK对所述第二密文进行解密,生成第一明文;a first decryption unit 1904, configured to call the first SDK to decrypt the second ciphertext to generate the first plaintext;
第一处理单元1905,用于基于所述第一明文,处理所述第一业务。A first processing unit 1905, configured to process the first service based on the first plaintext.
在一实施例中,所述第一加密单元1901在调用第一软件开发工具包SDK,基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文时,还用于:In one embodiment, the first encryption unit 1901 is calling the first software development kit SDK, and based on at least one encryption method supported by the first SDK, encrypts the first data about the first service, and generates a When the first ciphertext is used, it is also used for:
在所述第一SDK支持的至少一种加密方式中选择第一加密方式或第二加密方式的情况下,基于第一加密方式的第一加密算法或第二加密方式的第二加密算法,根据客户端的第一私钥信息与服务器的第一公钥信息,对所述第一数据进行加密,生成所述第一密文;第一加密算法为RAS算法;所述第二加密算法为椭圆曲线ECC算法;In the case where the first encryption method or the second encryption method is selected from at least one encryption method supported by the first SDK, based on the first encryption algorithm of the first encryption method or the second encryption algorithm of the second encryption method, according to the The first private key information of the client and the first public key information of the server encrypt the first data to generate the first ciphertext; the first encryption algorithm is the RAS algorithm; the second encryption algorithm is an elliptic curve ECC algorithm;
第一解密单元1904在所述调用所述第一SDK对所述第二密文进行解密,生成第一明文时,还用于:When the first decryption unit 1904 calls the first SDK to decrypt the second ciphertext and generates the first plaintext, the first decryption unit 1904 is also used to:
根据服务器的第二私钥信息对所述第二密文进行解密,生成所述第一明文;所述服务器的第二私钥信息是基于客户端的第二公钥信息确定的。The second ciphertext is decrypted according to the second private key information of the server to generate the first plaintext; the second private key information of the server is determined based on the second public key information of the client.
在一实施例中,所述第一加密单元1901在调用第一软件开发工具包SDK,基于所述第一SDK支持的至少一种加密方式,对关于第一业务的第一数据进行加密,生成第一密文时,还用于:In one embodiment, the first encryption unit 1901 is calling the first software development kit SDK, and based on at least one encryption method supported by the first SDK, encrypts the first data about the first service, and generates a When the first ciphertext is used, it is also used for:
在所述第一SDK支持的至少一种加密方式中选择第三加密方式的情况下,向密钥管理平台发送第二请求;所述第二请求用于请求分配客户端与服务器之间的通信密钥信息;In the case where a third encryption method is selected from at least one encryption method supported by the first SDK, a second request is sent to the key management platform; the second request is used to request the communication between the distribution client and the server key information;
接收所述密钥管理平台返回的关于所述第二请求的第一响应;所述第一响应包括第一密钥信息和第二密钥信息;receiving a first response about the second request returned by the key management platform; the first response includes first key information and second key information;
根据所述第一密钥信息加密所述第一数据,生成所述第一密文。The first data is encrypted according to the first key information to generate the first ciphertext.
第一解密单元1904在所述调用所述第一SDK对所述第二密文进行解密,生成第一明文时,还用于:When the first decryption unit 1904 calls the first SDK to decrypt the second ciphertext and generates the first plaintext, the first decryption unit 1904 is also used to:
通过所述第二密钥信息,对所述第二密文进行解密,生成所述第一明文。Using the second key information, the second ciphertext is decrypted to generate the first plaintext.
在一实施例中,所述装置还用于:In one embodiment, the device is further used to:
向密钥管理平台发送第四请求;所述第四请求用于请求获取新版本的业务证书;所述业务证书包括所述服务器的第一公钥信息;sending a fourth request to the key management platform; the fourth request is used to request to obtain a new version of the service certificate; the service certificate includes the first public key information of the server;
接收所述密钥管理平台基于所述第四请求返回的第三响应;所述第三响应表征最新版本的业务证书。A third response returned by the key management platform based on the fourth request is received; the third response represents the latest version of the service certificate.
实际应用时,第一加密单元1901、第一发送单元1902、第一接收单元1903、第一解密单元1904、第一处理单元1905可由数据传输装置中的处理器来实现。当然,处理器需要运行存储器中存储的程序来实现上述各程序模块的功能。In practical application, the first encryption unit 1901, the first sending unit 1902, the first receiving unit 1903, the first decrypting unit 1904, and the first processing unit 1905 may be implemented by a processor in the data transmission device. Of course, the processor needs to run the program stored in the memory to realize the functions of the above program modules.
需要说明的是,上述图19实施例提供的数据传输装置在进行数据传输时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的数据传输装置与数据传输方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, when the data transmission device provided in the above embodiment of FIG. 19 performs data transmission, only the division of the above program modules is used as an example for illustration. In practical applications, the above processing may be allocated to different program modules as required. Completion means dividing the internal structure of the device into different program modules to complete all or part of the processing described above. In addition, the data transmission apparatus and the data transmission method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
本申请实施例还提供了另一种数据传输装置,如图20所示,应用于服务器,包括:The embodiment of the present application also provides another data transmission device, as shown in FIG. 20, applied to a server, including:
第二接收单元2001,用于接收客户端发送的第一请求;所述第一请求携带第一密文;所述第一密文表征关于第一业务的第一数据的加密结果;所述第一请求用于请求处理所述第一业务;The second receiving unit 2001 is configured to receive a first request sent by a client; the first request carries a first ciphertext; the first ciphertext represents an encryption result of the first data of the first service; the first ciphertext a request for processing the first service;
第二解密单元2002,用于调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果;所述第一解密结果表征关于所述第一请求的解密结果;The second decryption unit 2002 is configured to call the second software development kit SDK, and generate a first decryption result according to the encryption method of the first ciphertext; the first decryption result represents the decryption result about the first request ;
第二处理单元2003,用于根据所述第一解密结果,对所述第一业务进行处理,生成第一处理结果;a second processing unit 2003, configured to process the first service according to the first decryption result to generate a first processing result;
第二加密单元2004,用于调用所述第二SDK对所述第一处理结果进行加密,生成第二密文;A second encryption unit 2004, configured to call the second SDK to encrypt the first processing result and generate a second ciphertext;
第二发送单元2005,将所述第二密文返回至所述客户端。The second sending unit 2005 returns the second ciphertext to the client.
在一实施例中,所述第二解密单元2002在调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果时,还用于:In one embodiment, when the second decryption unit 2002 calls the second software development kit SDK to generate the first decryption result according to the encryption method of the first ciphertext, it is also used to:
在所述客户端适用非证书类鉴权的情况下,调用所述第二SDK,确定第二处理结果;所述第二处理结果表征所述客户端的鉴权结果;In the case where non-certificate authentication is applied to the client, the second SDK is called to determine a second processing result; the second processing result represents the authentication result of the client;
在所述第二处理结果表征所述客户端具有访问所述服务器的权利的情况下,调用所述第二SDK,根据所述第一密文的加密方式,生成所述第一解密结果;In the case that the second processing result indicates that the client has the right to access the server, the second SDK is invoked, and the first decryption result is generated according to the encryption method of the first ciphertext;
在所述第二处理结果表征所述客户端不具有访问所述服务器的权利的情况下,向所述客户端返回的关于所述第一请求的第四响应;所述第四响应表征拒绝处理所述第一业务。In the case that the second processing result represents that the client does not have the right to access the server, a fourth response regarding the first request returned to the client; the fourth response represents refusal to process the first business.
在一实施例中,所述第二解密单元2002在调用第二软件开发工具包SDK,根据所述第一密文的加密方式,生成第一解密结果时,还用于:In one embodiment, when the second decryption unit 2002 calls the second software development kit SDK to generate the first decryption result according to the encryption method of the first ciphertext, it is also used to:
根据所述第一密文的加密方式,向密钥管理平台发送第五请求;所述第五请求用于请求获取解密所述第一密文的密钥信息;Send a fifth request to the key management platform according to the encryption method of the first ciphertext; the fifth request is used to request to obtain key information for decrypting the first ciphertext;
根据所述密钥管理平台返回的关于所述第五请求的第五响应,对所述第一密文进行解密,生成所述第一解密结果;其中,Decrypt the first ciphertext according to the fifth response about the fifth request returned by the key management platform to generate the first decryption result; wherein,
在所述第一密文的加密方式为第一加密方式,所述第五响应包括所述服务器的第二私钥信息;When the encryption mode of the first ciphertext is the first encryption mode, the fifth response includes the second private key information of the server;
在所述第一密文的加密方式为第一加密方式,所述第五响应包括第三密钥信息;所述第三密钥信息为AES密钥信息;The encryption method of the first ciphertext is the first encryption method, and the fifth response includes third key information; the third key information is AES key information;
第二加密单元2004在调用所述第二SDK对所述第一处理结果进行加密,生成第二密文时,还用于:When the second encryption unit 2004 calls the second SDK to encrypt the first processing result and generates the second ciphertext, it is further configured to:
基于第一加密方式的第一加密算法或第二加密方式的第二加密算法,根据所述服务器的第二私钥信息与客户端的第二公钥信息,对所述第一处理结果进行加密,生成所述第二密文;第一加密算法为RAS算法;所述第二加密算法为椭圆曲线ECC算法。Based on the first encryption algorithm of the first encryption method or the second encryption algorithm of the second encryption method, according to the second private key information of the server and the second public key information of the client, the first processing result is encrypted, The second ciphertext is generated; the first encryption algorithm is the RAS algorithm; the second encryption algorithm is the elliptic curve ECC algorithm.
在一实施例中,所述加密方式为第三加密方式的情况下,所述第五响应包括第一密钥信息与第二密钥信息;所述第一密钥信息与第二密钥信息表征客户端与所述服务器之间的通信密钥信息;In an embodiment, when the encryption method is the third encryption method, the fifth response includes first key information and second key information; the first key information and the second key information Characterize the communication key information between the client and the server;
第二加密单元2004在调用所述第二SDK对所述第一处理结果进行加密,生成第二密文时,还用于:When the second encryption unit 2004 calls the second SDK to encrypt the first processing result and generates the second ciphertext, it is further configured to:
根据所述第二密钥信息,对所述第一处理结果进行加密,生成所述第二密文。According to the second key information, the first processing result is encrypted to generate the second ciphertext.
在一实施例中,所述装置还用于:In one embodiment, the device is further used to:
在无法生成所述第一解密结果的情况下,向所述密钥管理平台发送第六响应;所述第六响应表征对所述第一密文解密失败。In the case that the first decryption result cannot be generated, a sixth response is sent to the key management platform; the sixth response indicates that the decryption of the first ciphertext fails.
实际应用时,第二接收单元2001、第二解密单元2002、第二处理单元2003、第二加密单元2004、第二发送单元2005可由数据传输装置中的处理器来实现。当然,处理器需要运行存储器中存储的程序来实现上述各程序模块的功能。In practical applications, the second receiving unit 2001 , the second decrypting unit 2002 , the second processing unit 2003 , the second encrypting unit 2004 , and the second sending unit 2005 may be implemented by a processor in the data transmission device. Of course, the processor needs to run the program stored in the memory to realize the functions of the above program modules.
需要说明的是,上述图20实施例提供的数据传输装置在进行数据传输时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的数据传输装置与数据传输方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, when the data transmission device provided in the above-mentioned embodiment of FIG. 20 performs data transmission, only the division of the above-mentioned program modules is used as an example for illustration. In practical applications, the above-mentioned processing may be allocated to different program modules as required Completion means dividing the internal structure of the device into different program modules to complete all or part of the processing described above. In addition, the data transmission apparatus and the data transmission method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments, which will not be repeated here.
本申请实施例还提供了另一种数据传输装置,如图21所示,应用于密钥管理平台,包括:The embodiment of the present application also provides another data transmission device, as shown in FIG. 21, applied to the key management platform, including:
第三接收单元2101,用于接收客户端或服务器发送的密钥管理请求;A third receiving unit 2101, configured to receive a key management request sent by a client or a server;
第一生成单元2102,用于根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应;a first generating unit 2102, configured to invoke a key service corresponding to the request according to the key management request, and generate a response to the key management request;
第三发送单元2103,将关于所述密钥管理请求的响应返回至所述客户端或服务器。The third sending unit 2103 returns a response about the key management request to the client or server.
在一实施例中,第一生成单元2102在根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应时,还用于:In one embodiment, when the first generating unit 2102 invokes a key service corresponding to the request according to the key management request, and generates a response to the key management request, it is further configured to:
在所述密钥管理请求为第二请求的情况下,调用第一密钥服务和第一工具,生成关于所述第二请求的第一响应;所述第一响应包括第一密钥信息与第二密钥信息;所述第一密钥服务表征密钥协商服务;所述第二请求用于请求分配所述客户端与所述服务器之间的通信密钥信息。In the case that the key management request is a second request, the first key service and the first tool are invoked to generate a first response to the second request; the first response includes the first key information and the second key information; the first key service represents a key agreement service; the second request is used for requesting distribution of communication key information between the client and the server.
在一实施例中,第一生成单元2102在根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应时,还用于:In one embodiment, when the first generating unit 2102 invokes a key service corresponding to the request according to the key management request, and generates a response to the key management request, it is further configured to:
在所述密钥管理请求为第三请求的情况下,调用第二密钥服务,确定第三处理结果;所述第三处理结果表征对所述客户端进行鉴权的结果;所述第二密钥服务表征鉴权服务;When the key management request is a third request, the second key service is invoked to determine a third processing result; the third processing result represents the result of authenticating the client; the second The key service represents the authentication service;
在所述第三处理结果表征允许所述客户端访问所述密钥管理平台的情况下,调用第三密钥服务对客户端的第二公钥信息进行登记,生成第二响应;所述第二响应表征所述第二公钥信息登记成功;所述第三密钥服务表征密钥登记服务。In the case that the third processing result indicates that the client is allowed to access the key management platform, the third key service is invoked to register the second public key information of the client, and a second response is generated; the second The response indicates that the registration of the second public key information is successful; the third key service indicates the key registration service.
在一实施例中,第一生成单元2102在根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应时,还用于:In one embodiment, when the first generating unit 2102 invokes a key service corresponding to the request according to the key management request, and generates a response to the key management request, it is further configured to:
在所述密钥管理请求为第四请求的情况下,调用第三密钥服务,生成第三响应;所述第三密钥服务表征所述第三密钥服务表征密钥登记服务;所述第三响应表征最新版本的业务证书。In the case that the key management request is a fourth request, a third key service is called to generate a third response; the third key service represents the third key service and the key registration service; the The third response represents the latest version of the service certificate.
在一实施例中,第一生成单元2102在根据所述密钥管理请求,调用与所述请求相对应的密钥服务,生成关于所述密钥管理请求的响应时,还用于:In one embodiment, when the first generating unit 2102 invokes a key service corresponding to the request according to the key management request, and generates a response to the key management request, it is further configured to:
在所述密钥管理请求为第五请求的情况下,调用第一密钥服务;所述第五请求用于请求获取解密所述第一密文的密钥信息;所述第一密钥服务表征密钥协商服务;When the key management request is a fifth request, the first key service is called; the fifth request is used to request to obtain key information for decrypting the first ciphertext; the first key service Characterize the key agreement service;
根据所述第一密文的加密方式,生成第五响应;所述第五响应包括解密所述第一密文的密钥信息。A fifth response is generated according to the encryption method of the first ciphertext; the fifth response includes key information for decrypting the first ciphertext.
在一实施例中,第一生成单元2102在根据所述第一密文的加密方式,生成第五响应时,还用于:In one embodiment, when generating the fifth response according to the encryption method of the first ciphertext, the first generating unit 2102 is further configured to:
在所述第一密文的加密方式为第一加密方式的情况下,调用第一工具,获取所述服务器的第一私钥信息;When the encryption method of the first ciphertext is the first encryption method, call the first tool to obtain the first private key information of the server;
在所述第一密文的加密方式为第二加密方式的情况下,调用第一工具,获取所述第三密钥信息;所述第三密钥信息表征AES密钥信息;When the encryption method of the first ciphertext is the second encryption method, the first tool is invoked to obtain the third key information; the third key information represents the AES key information;
在所述第一密文的加密方式为第三方式的情况下,根据第一标记,获取第一密钥信息与第二密钥信息;所述第一标记表征所述第一密钥服务历史协商所述服务器与所述客户端之间的密钥信息。When the encryption mode of the first ciphertext is the third mode, the first key information and the second key information are obtained according to the first mark; the first mark represents the service history of the first key Negotiate key information between the server and the client.
在一实施例中,所述装置还用于:In one embodiment, the device is further used to:
在无法获取解密所述第一密文的密钥信息的情况下,生成第七响应;所述第七响应表征协商密钥信息失败。In the case that the key information for decrypting the first ciphertext cannot be obtained, a seventh response is generated; the seventh response represents a failure to negotiate the key information.
基于上述程序模块的硬件实现,且为了实现本申请实施例的方法,本申请实施例还提供了一种电子设备,图22为本申请实施例电子设备的硬件组成结构示意图,如图22所示,电子设备包括:Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device. FIG. 22 is a schematic diagram of the hardware structure of the electronic device according to the embodiment of the present application, as shown in FIG. 22 . , electronic equipment including:
通信接口1,能够与其它设备比如网络设备等进行信息交互;Communication interface 1, which can exchange information with other devices such as network devices;
处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机程序时,执行上述一个或多个技术方案提供的数据传输方法。而所述计算机程序存储在存储器3上。The
当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图22中将各种总线都标为总线系统4。Of course, in practical application, various components in the electronic device are coupled together through the
本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机程序。The
可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器3旨在包括但不限于这些和任意其它适合类型的存储器。It is understood that the
上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present application may be applied to the
处理器2执行所述程序时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。When the
在示例性实施例中,本申请实施例还提供了一种存储介质,即计算机存储介质,具体为计算机可读存储介质,例如包括存储计算机程序的存储器3,上述计算机程序可由处理器2执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器。In an exemplary embodiment, the embodiment of the present application further provides a storage medium, that is, a computer storage medium, specifically a computer-readable storage medium, for example, including a
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、终端和方法,可以通过其它的方式实现。以上所描述的设备实施例仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, terminal and method may be implemented in other manners. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other media that can store program codes.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、或者网络设备等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence or in the parts that make contributions to the prior art. The computer software products are stored in a storage medium and include several instructions for An electronic device (which may be a personal computer, a server, or a network device, etc.) is caused to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk or an optical disk and other mediums that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims (22)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111493588.5A CN114338091B (en) | 2021-12-08 | 2021-12-08 | Data transmission method, device, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111493588.5A CN114338091B (en) | 2021-12-08 | 2021-12-08 | Data transmission method, device, electronic device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114338091A true CN114338091A (en) | 2022-04-12 |
| CN114338091B CN114338091B (en) | 2024-05-07 |
Family
ID=81050065
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111493588.5A Active CN114338091B (en) | 2021-12-08 | 2021-12-08 | Data transmission method, device, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114338091B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115396226A (en) * | 2022-08-31 | 2022-11-25 | 海宁奕斯伟集成电路设计有限公司 | Data transmission method, device and storage medium |
| CN115499250A (en) * | 2022-11-17 | 2022-12-20 | 北京搜狐新动力信息技术有限公司 | A data encryption method and device |
| WO2024141094A1 (en) * | 2022-12-30 | 2024-07-04 | 汉熵通信有限公司 | Distributed encryption and decryption method, apparatus, system and medium |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103812871A (en) * | 2014-02-24 | 2014-05-21 | 北京明朝万达科技有限公司 | Development method and system based on mobile terminal application program security application |
| CN105025470A (en) * | 2014-04-18 | 2015-11-04 | 中国移动通信集团公司 | A service request processing method, system and related device |
| CN109981641A (en) * | 2019-03-26 | 2019-07-05 | 北京邮电大学 | A kind of safe distribution subscription system and distribution subscription method based on block chain technology |
| CN110570275A (en) * | 2019-08-19 | 2019-12-13 | 香港乐蜜有限公司 | Order checking method and device, electronic equipment and storage medium |
| WO2021022701A1 (en) * | 2019-08-08 | 2021-02-11 | 平安科技(深圳)有限公司 | Information transmission method and apparatus, client terminal, server, and storage medium |
| WO2021103708A1 (en) * | 2019-11-26 | 2021-06-03 | 支付宝(杭州)信息技术有限公司 | Data query method, apparatus, device and system based on privacy information protection |
| CN113010856A (en) * | 2021-03-02 | 2021-06-22 | 北京顶象技术有限公司 | Dynamic asymmetric encryption and decryption JavaScript code obfuscation method and system |
| CN113204772A (en) * | 2021-04-26 | 2021-08-03 | 五八有限公司 | Data processing method, device, system, terminal, server and storage medium |
| CN113497778A (en) * | 2020-03-18 | 2021-10-12 | 北京同邦卓益科技有限公司 | Data transmission method and device |
-
2021
- 2021-12-08 CN CN202111493588.5A patent/CN114338091B/en active Active
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103812871A (en) * | 2014-02-24 | 2014-05-21 | 北京明朝万达科技有限公司 | Development method and system based on mobile terminal application program security application |
| CN105025470A (en) * | 2014-04-18 | 2015-11-04 | 中国移动通信集团公司 | A service request processing method, system and related device |
| CN109981641A (en) * | 2019-03-26 | 2019-07-05 | 北京邮电大学 | A kind of safe distribution subscription system and distribution subscription method based on block chain technology |
| WO2021022701A1 (en) * | 2019-08-08 | 2021-02-11 | 平安科技(深圳)有限公司 | Information transmission method and apparatus, client terminal, server, and storage medium |
| CN110570275A (en) * | 2019-08-19 | 2019-12-13 | 香港乐蜜有限公司 | Order checking method and device, electronic equipment and storage medium |
| WO2021103708A1 (en) * | 2019-11-26 | 2021-06-03 | 支付宝(杭州)信息技术有限公司 | Data query method, apparatus, device and system based on privacy information protection |
| CN113497778A (en) * | 2020-03-18 | 2021-10-12 | 北京同邦卓益科技有限公司 | Data transmission method and device |
| CN113010856A (en) * | 2021-03-02 | 2021-06-22 | 北京顶象技术有限公司 | Dynamic asymmetric encryption and decryption JavaScript code obfuscation method and system |
| CN113204772A (en) * | 2021-04-26 | 2021-08-03 | 五八有限公司 | Data processing method, device, system, terminal, server and storage medium |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115396226A (en) * | 2022-08-31 | 2022-11-25 | 海宁奕斯伟集成电路设计有限公司 | Data transmission method, device and storage medium |
| CN115499250A (en) * | 2022-11-17 | 2022-12-20 | 北京搜狐新动力信息技术有限公司 | A data encryption method and device |
| WO2024141094A1 (en) * | 2022-12-30 | 2024-07-04 | 汉熵通信有限公司 | Distributed encryption and decryption method, apparatus, system and medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114338091B (en) | 2024-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5860815B2 (en) | System and method for enforcing computer policy | |
| CN102217277B (en) | Method and system for token-based authentication | |
| US7526649B2 (en) | Session key exchange | |
| EP2954448B1 (en) | Provisioning sensitive data into third party network-enabled devices | |
| US12113898B2 (en) | Binding with cryptographic key attestation | |
| CN108768988A (en) | Block chain access control method, equipment and computer readable storage medium | |
| US10257171B2 (en) | Server public key pinning by URL | |
| US12132839B2 (en) | Decentralised authentication | |
| CN102984273B (en) | Encryption method, decryption method, encryption device and decryption device of virtual disk and cloud server | |
| CN110443049A (en) | Method and system for managing security data storage and security storage management module | |
| CN114338091B (en) | Data transmission method, device, electronic device and storage medium | |
| CN113556230B (en) | Data security transmission method, certificate related method, server, system and medium | |
| CN102986161A (en) | Method for the cryptographic protection of an application | |
| EP4423970B1 (en) | Method to establish a secure channel | |
| CN106992978B (en) | Network security management method and server | |
| CN114826702B (en) | Database access password encryption method and device and computer equipment | |
| KR100970552B1 (en) | How to generate a security key using a non-certificate public key | |
| CN104753879A (en) | Method and system for authenticating cloud service provider through terminal and method and system for authenticating terminal through cloud service provider | |
| US20240413988A1 (en) | Multi-factor authentication hardening | |
| CN114979071B (en) | Dynamic domain name configuration method, device, electronic equipment and storage medium | |
| CN117728958A (en) | A communication method, device and system | |
| KR101893758B1 (en) | System and method for monitoring leakage of internal information through analyzing encrypted traffic | |
| US20240422015A1 (en) | Method and apparatus for authenticating iot devices | |
| CN118802131B (en) | Authentication methods, related equipment, storage media, and computer program products | |
| Culnane et al. | Formalising Application-Driven Authentication & Access-Control based on Users’ Companion Devices |
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 | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250418 Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Country or region after: China Address before: 311100 room 1001, building 9, Xixi bafangcheng, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province Patentee before: Hangzhou douku Software Technology Co.,Ltd. Country or region before: China |
