CN114417369A - File transmission method and device, electronic equipment and computer readable medium - Google Patents

File transmission method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN114417369A
CN114417369A CN202111590677.1A CN202111590677A CN114417369A CN 114417369 A CN114417369 A CN 114417369A CN 202111590677 A CN202111590677 A CN 202111590677A CN 114417369 A CN114417369 A CN 114417369A
Authority
CN
China
Prior art keywords
key
file
secret key
ciphertext
symmetric
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111590677.1A
Other languages
Chinese (zh)
Inventor
王振生
陈大平
程明远
樊广源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111590677.1A priority Critical patent/CN114417369A/en
Publication of CN114417369A publication Critical patent/CN114417369A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了文件传输方法、装置、电子设备和计算机可读介质,涉及大数据隐私保护技术领域。该方法的一具体实施方式包括:接收用户端发送的秘钥获取请求;生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4对称秘钥;对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文;将所述第一秘钥密文发送至所述用户端;向所述用户端发送秘钥获取请求;接收所述用户端返回的第二秘钥密文;对所述第二秘钥密文进行解密,得到第二SM2公钥。该实施方式能够解决无法满足用户系统与银行系统之间的安全需求的技术问题。

Figure 202111590677

The invention discloses a file transmission method, an apparatus, an electronic device and a computer-readable medium, and relates to the technical field of big data privacy protection. A specific implementation of the method includes: receiving a key acquisition request sent by a client; generating a first SM2 public key and its corresponding first SM2 private key, and generating an SM4 symmetric key; encryption key and the SM4 symmetric key to obtain the first secret key ciphertext; send the first secret key ciphertext to the client; send a key acquisition request to the client; receive the user The second secret key ciphertext returned by the terminal; decrypt the second secret key ciphertext to obtain the second SM2 public key. This embodiment can solve the technical problem that the security requirements between the user system and the banking system cannot be met.

Figure 202111590677

Description

文件传输方法、装置、电子设备和计算机可读介质File transfer method, apparatus, electronic device and computer readable medium

技术领域technical field

本发明涉及大数据隐私保护技术领域,尤其涉及文件传输方法、装置、电子设备和计算机可读介质。The present invention relates to the technical field of big data privacy protection, and in particular, to a file transmission method, apparatus, electronic device and computer-readable medium.

背景技术Background technique

随着互联网的快速发展,原始的银企非直联合作方式,例如使用银行的网银系统B/S模式或通过银行网点进行企业账务处理后,再与企业财务系统进行人工落地对接处理的业务流程,将导致企业业务处理不连贯,工作效率低,并且在保证银行系统与企业财务系统账务一致性问题上存在风险。With the rapid development of the Internet, the original non-direct cooperation between banks and enterprises, such as using the B/S mode of the bank's online banking system or processing corporate accounts through bank outlets, and then manually docking with the corporate financial system. The process will lead to incoherent business processing, low work efficiency, and there are risks in ensuring the consistency of accounts between the banking system and the enterprise financial system.

银企直联可以彻底解决以上弊端,同时银企直联系统利用成熟的商密技术,向用户提供不间断的银行服务,实现了企业ERP或财务系统业务操作的7*24连续性、账务一致性。The bank-enterprise direct connection can completely solve the above drawbacks. At the same time, the bank-enterprise direct connection system uses mature business secret technology to provide users with uninterrupted banking services, and realizes the 7*24 continuity of business operations of enterprise ERP or financial systems, accounting consistency.

但是,目前的银企直联系统直接推送数据,缺少身份认证、安全加密、数字签名等各方面的安全措施,因此无法满足用户系统与银行系统之间的安全需求。However, the current bank-enterprise direct connection system directly pushes data and lacks various security measures such as identity authentication, security encryption, and digital signature, so it cannot meet the security requirements between the user system and the bank system.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例提供一种文件传输方法、装置、电子设备和计算机可读介质,以解决无法满足用户系统与银行系统之间的安全需求的技术问题。In view of this, embodiments of the present invention provide a file transmission method, apparatus, electronic device, and computer-readable medium to solve the technical problem that the security requirements between the user system and the banking system cannot be met.

为实现上述目的,根据本发明实施例的一个方面,提供了一种文件传输方法,应用于银行端,包括:In order to achieve the above object, according to an aspect of the embodiments of the present invention, a file transmission method is provided, which is applied to a bank, including:

接收用户端发送的秘钥获取请求;Receive the key acquisition request sent by the client;

生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4 对称秘钥;generating a first SM2 public key and its corresponding first SM2 private key, and generating an SM4 symmetric secret key;

对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文;Encrypting the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext;

将所述第一秘钥密文发送至所述用户端;sending the first secret key ciphertext to the client;

向所述用户端发送秘钥获取请求;sending a key acquisition request to the client;

接收所述用户端返回的第二秘钥密文;receiving the second secret key ciphertext returned by the client;

对所述第二秘钥密文进行解密,得到第二SM2公钥。Decrypt the second secret key ciphertext to obtain the second SM2 public key.

可选地,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文,包括:Optionally, encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext, including:

根据所述用户端的用户标识和预设参数,组装成第一加密参数;According to the user identification and preset parameters of the user terminal, the first encryption parameter is assembled;

基于所述第一加密参数并采用对称加密算法,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文。Based on the first encryption parameter and using a symmetric encryption algorithm, encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.

可选地,对所述第二秘钥密文进行解密,得到第二SM2公钥,包括:Optionally, decrypt the second secret key ciphertext to obtain a second SM2 public key, including:

根据所述银行端的用户标识和预设参数,组装成第一解密参数;According to the user identification and preset parameters of the bank terminal, the first decryption parameter is assembled;

基于所述第一解密参数并采用对称加密算法,对所述第二秘钥密文进行解密,得到第二SM2公钥。Based on the first decryption parameter and using a symmetric encryption algorithm, the second secret key ciphertext is decrypted to obtain a second SM2 public key.

可选地,对所述第二秘钥密文进行解密,得到第二SM2公钥之后,还包括:Optionally, after decrypting the second secret key ciphertext to obtain the second SM2 public key, the method further includes:

接收用户端发送的文件获取请求;Receive the file acquisition request sent by the client;

对所述文件获取请求进行验签和解密,得到待传输文件的信息;Perform signature verification and decryption on the file acquisition request to obtain the information of the file to be transmitted;

采用所述SM4对称秘钥对所述待传输文件进行加密,得到文件密文;Encrypt the file to be transmitted by using the SM4 symmetric key to obtain a file ciphertext;

采用所述第一SM2私钥对所述文件密文进行数字签名,得到文件签名;Using the first SM2 private key to digitally sign the file ciphertext to obtain a file signature;

将所述文件签名发送至所述用户端。Send the file signature to the client.

可选地,对所述文件获取请求进行验签和解密,包括:Optionally, performing signature verification and decryption on the file acquisition request, including:

采用第二SM2公钥对所述文件获取请求进行验签;Use the second SM2 public key to verify the signature of the file acquisition request;

若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到待传输文件的信息。If the signature verification is passed, the signature verification result is decrypted by using the SM4 symmetric key to obtain the information of the file to be transmitted.

另外,根据本发明实施例的另一个方面,提供了一种文件传输方法,应用于用户端,包括:In addition, according to another aspect of the embodiments of the present invention, a file transmission method is provided, applied to a client, including:

向银行端发送秘钥获取请求;Send a key acquisition request to the bank;

接收所述银行端返回的第一秘钥密文;receiving the first secret key ciphertext returned by the bank;

对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥;Decrypt the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric secret key;

接收所述银行端发送的秘钥获取请求;receiving a key acquisition request sent by the bank;

生成第二SM2公钥及其对应的第二SM2私钥;generating a second SM2 public key and its corresponding second SM2 private key;

对所述第二SM2公钥进行加密,得到第二秘钥密文;Encrypting the second SM2 public key to obtain a second secret key ciphertext;

将所述第二秘钥密文发送至所述银行端。Send the second secret key ciphertext to the bank.

可选地,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4 对称秘钥,包括:Optionally, decrypt the first secret key ciphertext to obtain the first SM2 public key and SM4 symmetric secret key, including:

根据所述用户端的用户标识和预设参数,组装成第二解密参数;According to the user identification and preset parameters of the user terminal, the second decryption parameter is assembled;

基于所述第二解密参数并采用对称加密算法,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。Based on the second decryption parameter and using a symmetric encryption algorithm, the first secret key ciphertext is decrypted to obtain the first SM2 public key and the SM4 symmetric secret key.

可选地,对所述第二SM2公钥进行加密,得到第二秘钥密文,包括:Optionally, encrypting the second SM2 public key to obtain a second secret key ciphertext, including:

根据所述银行端的用户标识和预设参数,组装成第二加密参数;According to the user identification and preset parameters of the bank end, the second encryption parameter is assembled;

基于所述第二加密参数并采用对称加密算法,对所述第二SM2公钥进行加密,得到第二秘钥密文。Encrypting the second SM2 public key based on the second encryption parameter and using a symmetric encryption algorithm to obtain a second secret key ciphertext.

可选地,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4 对称秘钥之后,还包括:Optionally, after decrypting the first secret key ciphertext to obtain the first SM2 public key and SM4 symmetric secret key, the method further includes:

根据待传输文件的信息生成报文;Generate a message according to the information of the file to be transmitted;

采用所述第二SM2私钥对所述报文进行加密,得到报文密文;Encrypt the message by using the second SM2 private key to obtain a message ciphertext;

采用所述SM4对称秘钥对所述报文密文进行数字验签,得到报文签名;Using the SM4 symmetric key to perform digital signature verification on the message ciphertext to obtain a message signature;

向所述银行端发送文件获取请求,所述文件获取请求携带所述报文签名。A file acquisition request is sent to the bank, where the file acquisition request carries the message signature.

可选地,向所述银行端发送文件获取请求之后,还包括:Optionally, after sending the file acquisition request to the bank, the method further includes:

接收所述银行端返回的文件签名;receiving the document signature returned by the bank;

采用所述第一SM2公钥对所述文件签名进行验签;Verifying the file signature by using the first SM2 public key;

若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到文件。If the signature verification is passed, the signature verification result is decrypted using the SM4 symmetric key to obtain a file.

另外,根据本发明实施例的另一个方面,提供了一种文件传输装置,设置于银行端,包括:In addition, according to another aspect of the embodiments of the present invention, there is provided a file transmission device, which is set at the bank end, including:

第一接收模块,用于接收用户端发送的秘钥获取请求;接收所述用户端返回的第二秘钥密文;a first receiving module, configured to receive a key acquisition request sent by the client; receive the second secret key ciphertext returned by the client;

第一秘钥模块,用于生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4对称秘钥;a first key module for generating a first SM2 public key and its corresponding first SM2 private key, and generating an SM4 symmetric key;

第一加密模块,用于对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文;a first encryption module, configured to encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext;

第一发送模块,用于将所述第一秘钥密文发送至所述用户端;向所述用户端发送秘钥获取请求;a first sending module, configured to send the first secret key ciphertext to the client; send a secret key acquisition request to the client;

第一解密模块,用于对所述第二秘钥密文进行解密,得到第二SM2 公钥。The first decryption module is used for decrypting the second secret key ciphertext to obtain the second SM2 public key.

可选地,所述第一加密模块还用于:Optionally, the first encryption module is also used for:

根据所述用户端的用户标识和预设参数,组装成第一加密参数;According to the user identification and preset parameters of the user terminal, the first encryption parameter is assembled;

基于所述第一加密参数并采用对称加密算法,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文。Based on the first encryption parameter and using a symmetric encryption algorithm, encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.

可选地,所述第一解密模块还用于:Optionally, the first decryption module is also used for:

根据所述银行端的用户标识和预设参数,组装成第一解密参数;According to the user identification and preset parameters of the bank terminal, the first decryption parameter is assembled;

基于所述第一解密参数并采用对称加密算法,对所述第二秘钥密文进行解密,得到第二SM2公钥。Based on the first decryption parameter and using a symmetric encryption algorithm, the second secret key ciphertext is decrypted to obtain a second SM2 public key.

可选地,所述第一接收模块还用于接收用户端发送的文件获取请求;Optionally, the first receiving module is further configured to receive a file acquisition request sent by the client;

所述第一解密模块还用于对所述文件获取请求进行验签和解密,得到待传输文件的信息;The first decryption module is also used to perform signature verification and decryption on the file acquisition request to obtain the information of the file to be transmitted;

所述第一加密模块还用于采用所述SM4对称秘钥对所述待传输文件进行加密,得到文件密文;采用所述第一SM2私钥对所述文件密文进行数字签名,得到文件签名;The first encryption module is further configured to encrypt the file to be transmitted by using the SM4 symmetric key to obtain a file ciphertext; use the first SM2 private key to digitally sign the file ciphertext to obtain a file sign;

所述第一发送模块还用于将所述文件签名发送至所述用户端。The first sending module is further configured to send the file signature to the client.

可选地,所述第一解密模块还用于:Optionally, the first decryption module is also used for:

采用第二SM2公钥对所述文件获取请求进行验签;Use the second SM2 public key to verify the signature of the file acquisition request;

若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到待传输文件的信息。If the signature verification is passed, the signature verification result is decrypted by using the SM4 symmetric key to obtain the information of the file to be transmitted.

另外,根据本发明实施例的另一个方面,提供了一种文件传输装置,设置于用户端,包括:In addition, according to another aspect of the embodiments of the present invention, there is provided a file transmission device, which is set at the user end and includes:

第二发送模块,用于向银行端发送秘钥获取请求;将所述第二秘钥密文发送至所述银行端;The second sending module is used for sending a key acquisition request to the bank; sending the second key ciphertext to the bank;

第二接收模块,用于接收所述银行端返回的第一秘钥密文;接收所述银行端发送的秘钥获取请求;The second receiving module is configured to receive the first secret key ciphertext returned by the bank; and receive the key acquisition request sent by the bank;

第二解密模块,用于对所述第一秘钥密文进行解密,得到第一SM2 公钥和SM4对称秘钥;The second decryption module is used for decrypting the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric secret key;

第二秘钥模块,用于生成第二SM2公钥及其对应的第二SM2私钥;The second key module is used to generate a second SM2 public key and its corresponding second SM2 private key;

第二加密模块,用于对所述第二SM2公钥进行加密,得到第二秘钥密文。The second encryption module is configured to encrypt the second SM2 public key to obtain a second secret key ciphertext.

可选地,所述第二解密模块还用于:Optionally, the second decryption module is also used for:

根据所述用户端的用户标识和预设参数,组装成第二解密参数;According to the user identification and preset parameters of the user terminal, the second decryption parameter is assembled;

基于所述第二解密参数并采用对称加密算法,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。Based on the second decryption parameter and using a symmetric encryption algorithm, the first secret key ciphertext is decrypted to obtain the first SM2 public key and the SM4 symmetric secret key.

可选地,所述第二加密模块还用于:Optionally, the second encryption module is also used for:

根据所述银行端的用户标识和预设参数,组装成第二加密参数;According to the user identification and preset parameters of the bank end, the second encryption parameter is assembled;

基于所述第二加密参数并采用对称加密算法,对所述第二SM2公钥进行加密,得到第二秘钥密文。Encrypting the second SM2 public key based on the second encryption parameter and using a symmetric encryption algorithm to obtain a second secret key ciphertext.

可选地,所述第二加密模块还用于:根据待传输文件的信息生成报文;采用所述第二SM2私钥对所述报文进行加密,得到报文密文;采用所述SM4对称秘钥对所述报文密文进行数字验签,得到报文签名;Optionally, the second encryption module is further configured to: generate a message according to the information of the file to be transmitted; use the second SM2 private key to encrypt the message to obtain a message ciphertext; use the SM4 The symmetric key performs digital signature verification on the ciphertext of the message to obtain a message signature;

所述第二发送模块还用于向所述银行端发送文件获取请求,所述文件获取请求携带所述报文签名。The second sending module is further configured to send a file acquisition request to the bank, where the file acquisition request carries the message signature.

可选地,所述第二接收模块还用于接收所述银行端返回的文件签名;Optionally, the second receiving module is further configured to receive the file signature returned by the bank;

所述第二解密模块还用于:采用所述第一SM2公钥对所述文件签名进行验签;若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到文件。The second decryption module is further configured to: verify the signature of the file by using the first SM2 public key; if the signature is verified, decrypt the signature verification result using the SM4 symmetric secret key to obtain the file.

根据本发明实施例的另一个方面,还提供了一种电子设备,包括:According to another aspect of the embodiments of the present invention, an electronic device is also provided, including:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序,storage means for storing one or more programs,

当所述一个或多个程序被所述一个或多个处理器执行时,所述一个或多个处理器实现上述任一实施例所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

根据本发明实施例的另一个方面,还提供了一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现上述任一实施例所述的方法。According to another aspect of the embodiments of the present invention, there is also provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements the method described in any of the foregoing embodiments.

根据本发明实施例的另一个方面,还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述任一实施例所述的方法。According to another aspect of the embodiments of the present invention, a computer program product is also provided, including a computer program, which implements the method described in any of the foregoing embodiments when the computer program is executed by a processor.

上述发明中的一个实施例具有如下优点或有益效果:因为采用生成第一SM2公钥及其对应的第一SM2私钥以及生成SM4对称秘钥,然后对第一SM2公钥和SM4对称秘钥进行加密,得到第一秘钥密文,接着将第一秘钥密文发送至用户端的技术手段,所以克服了现有技术中无法满足用户系统与银行系统之间的安全需求的技术问题。本发明实施例在银企直联系统的基础上,银行端基于SM4对称加解密和SM2 数字签名算法,为用户提供身份认证安全、安全加密和数字签名等各方面的安全需求,满足了用户系统与银行系统之间的安全需求。An embodiment of the above invention has the following advantages or beneficial effects: because the generation of the first SM2 public key and the corresponding first SM2 private key and the generation of the SM4 symmetric secret key are adopted, and then the first SM2 public key and the SM4 symmetric secret key are generated. The technical means of encrypting to obtain the first secret key ciphertext, and then sending the first secret key ciphertext to the client, overcomes the technical problem that the prior art cannot meet the security requirements between the user system and the banking system. The embodiment of the present invention is based on the bank-enterprise direct connection system, and the bank end is based on the SM4 symmetric encryption and decryption and the SM2 digital signature algorithm to provide users with various security requirements such as identity authentication security, security encryption, and digital signatures, and satisfies the user system. Security requirements with the banking system.

上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。Further effects of the above non-conventional alternatives will be described below in conjunction with specific embodiments.

附图说明Description of drawings

附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used for better understanding of the present invention and do not constitute an improper limitation of the present invention. in:

图1是根据本发明第一实施例的文件传输方法的主要流程的示意图;1 is a schematic diagram of the main flow of a file transmission method according to a first embodiment of the present invention;

图2是根据本发明的银行端和用户端的秘钥交互示意图;2 is a schematic diagram of the key interaction between a bank terminal and a user terminal according to the present invention;

图3是根据本发明第二实施例的文件传输方法的主要流程的示意图;3 is a schematic diagram of a main flow of a file transmission method according to a second embodiment of the present invention;

图4是根据本发明第四实施例的文件传输方法的主要流程的示意图;4 is a schematic diagram of a main flow of a file transmission method according to a fourth embodiment of the present invention;

图5是根据本发明第五实施例的文件传输方法的主要流程的示意图;5 is a schematic diagram of a main flow of a file transmission method according to a fifth embodiment of the present invention;

图6是根据本发明第一实施例的文件传输装置的主要模块的示意图;6 is a schematic diagram of the main modules of the file transmission device according to the first embodiment of the present invention;

图7是根据本发明第二实施例的文件传输装置的主要模块的示意图;FIG. 7 is a schematic diagram of the main modules of the file transmission device according to the second embodiment of the present invention;

图8是本发明实施例可以应用于其中的示例性系统架构图;FIG. 8 is an exemplary system architecture diagram to which an embodiment of the present invention may be applied;

图9是适于用来实现本发明实施例的终端设备或服务器的计算机系统的结构示意图。FIG. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.

具体实施方式Detailed ways

以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.

本申请技术方案中对数据的获取、存储、使用、处理等均符合国家法律法规的相关规定。The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.

图1是根据本发明第一实施例的文件传输方法的主要流程的示意图。作为本发明的一个实施例,如图1所示,所述文件传输方法应用于银行端,可以包括:FIG. 1 is a schematic diagram of the main flow of the file transmission method according to the first embodiment of the present invention. As an embodiment of the present invention, as shown in FIG. 1 , the file transfer method is applied to the bank, and may include:

步骤101,接收用户端发送的秘钥获取请求。Step 101: Receive a key acquisition request sent by a client.

为了能够对银行端发送的数据进行验签和解密,用户端需要从银行端获取秘钥。因此,用户端向银行端发送秘钥获取请求,银行端接收用户端发送的秘钥获取请求。In order to verify and decrypt the data sent by the bank, the client needs to obtain the secret key from the bank. Therefore, the client sends a key acquisition request to the bank, and the bank receives the key acquisition request sent by the client.

步骤102,生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4对称秘钥。Step 102, generating a first SM2 public key and its corresponding first SM2 private key, and generating an SM4 symmetric key.

银行端接收到用户端发送的秘钥获取请求之后,生成第一SM2公钥及其对应的第一SM2私钥,以及SM4对称秘钥。After the bank terminal receives the key acquisition request sent by the user terminal, it generates a first SM2 public key, its corresponding first SM2 private key, and an SM4 symmetric key.

SM2算法的全称为SM2椭圆曲线公钥密码算法,包括SM2-1椭圆曲线数字签名算法,SM2-2椭圆曲线秘钥交换协议,SM2-3椭圆曲线公钥加密算法,分别用于实现数字签名秘钥协商和数据加密等功能。 SM2算法与RSA算法不同的是,SM2算法是基于椭圆曲线上点群离散对数难题,相对于RSA算法,256位的SM2密码强度已经比2048位的RSA密码强度要高。The full name of SM2 algorithm is SM2 elliptic curve public key encryption algorithm, including SM2-1 elliptic curve digital signature algorithm, SM2-2 elliptic curve key exchange protocol, and SM2-3 elliptic curve public key encryption algorithm, which are respectively used to realize digital signature encryption. key agreement and data encryption. The difference between the SM2 algorithm and the RSA algorithm is that the SM2 algorithm is based on the point group discrete logarithm problem on the elliptic curve. Compared with the RSA algorithm, the 256-bit SM2 password is stronger than the 2048-bit RSA password.

SM4算法的全称是SM4分组对称密码算法,用于实现数据的加密 /解密运算,以保证数据和信息的机密性。SM4算法与AES算法具有相同的秘钥长度分组长度128比特,因此在安全性上高于3DES算法。The full name of the SM4 algorithm is the SM4 block symmetric cipher algorithm, which is used to implement data encryption/decryption operations to ensure the confidentiality of data and information. The SM4 algorithm has the same key length as the AES algorithm, and the block length is 128 bits, so it is higher in security than the 3DES algorithm.

步骤103,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文。Step 103: Encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.

为了安全地传输第一SM2公钥和SM4对称秘钥,银行端需要对生成的第一SM2公钥和SM4对称秘钥进行加密,得到第一秘钥密文。In order to securely transmit the first SM2 public key and the SM4 symmetric key, the bank needs to encrypt the generated first SM2 public key and the SM4 symmetric key to obtain the first key ciphertext.

可选地,步骤103可以包括:根据所述用户端的用户标识和预设参数,组装成第一加密参数;基于所述第一加密参数并采用对称加密算法,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文。在本发明的实施例中,银行端与用户端事先约定好了用户端的用户标识和参数生成规则,因此可以按照事先约定好的参数生成规则生成预设参数,从而将用户端的用户标识和预设参数组装成第一加密参数,接着基于生成的第一加密参数并采用对称加密算法(比如 DES算法),对第一SM2公钥和SM4对称秘钥进行加密,得到第一秘钥密文。Optionally, step 103 may include: assembling a first encryption parameter according to the user identifier of the user terminal and preset parameters; The SM4 symmetric key is encrypted to obtain the first key ciphertext. In the embodiment of the present invention, the bank terminal and the user terminal have agreed on the user identification and parameter generation rules of the user terminal in advance, so preset parameters can be generated according to the pre-agreed parameter generation rules, so that the user identification of the user terminal and the preset parameters can be generated. The parameters are assembled into a first encryption parameter, and then based on the generated first encryption parameter and a symmetric encryption algorithm (such as a DES algorithm), the first SM2 public key and the SM4 symmetric key are encrypted to obtain the first key ciphertext.

需要指出的是,可以对第一SM2公钥和SM4对称秘钥一起加密,也可以分别对第一SM2公钥和SM4对称秘钥进行加密(加密方法相同),本发明实施例对此不作限制。It should be noted that the first SM2 public key and the SM4 symmetric secret key may be encrypted together, or the first SM2 public key and the SM4 symmetric secret key may be encrypted separately (the encryption method is the same), which is not limited in this embodiment of the present invention .

步骤104,将所述第一秘钥密文发送至所述用户端。Step 104: Send the first secret key ciphertext to the client.

如图2所示,服务端将加密后的第一秘钥密文发送至用户端,用户端对其进行解密后,就可以获取银行端的第一SM2公钥和SM4对称秘钥。As shown in Figure 2, the server sends the encrypted first secret key ciphertext to the client, and after the client decrypts it, the client can obtain the first SM2 public key and SM4 symmetric key of the bank.

步骤105,向所述用户端发送秘钥获取请求。Step 105: Send a key acquisition request to the client.

为了能够对用户端发送的数据进行验签和解密,银行端需要从用户端获取秘钥。因此,银行端向用户端发送秘钥获取请求,用户端接收银行端发送的秘钥获取请求。In order to verify and decrypt the data sent by the client, the bank needs to obtain the secret key from the client. Therefore, the bank terminal sends a key acquisition request to the user terminal, and the user terminal receives the key acquisition request sent by the bank terminal.

步骤106,接收所述用户端返回的第二秘钥密文。Step 106: Receive the second secret key ciphertext returned by the user terminal.

用户端生成第二秘钥密文,然后将第二秘钥密文返回至银行端,银行端接收用户端返回的第二秘钥密文。The user end generates the second secret key ciphertext, and then returns the second secret key ciphertext to the bank end, and the bank end receives the second secret key ciphertext returned by the user end.

步骤107,对所述第二秘钥密文进行解密,得到第二SM2公钥。Step 107: Decrypt the second secret key ciphertext to obtain a second SM2 public key.

为了保证秘钥传输的安全性,用户端也快会对秘钥进行加密,因此银行端接收到用户端返回的第二秘钥密文之后,需要对第二秘钥密文进行解密,从而得到第二SM2公钥。In order to ensure the security of the key transmission, the client will soon encrypt the secret key. Therefore, after the bank receives the ciphertext of the second secret key returned by the client, it needs to decrypt the ciphertext of the second secret key, thereby obtaining Second SM2 public key.

可选地,步骤107可以包括:根据所述银行端的用户标识和预设参数,组装成第一解密参数;基于所述第一解密参数并采用对称加密算法,对所述第二秘钥密文进行解密,得到第二SM2公钥。在本发明的实施例中,银行端与用户端事先约定好了银行端的用户标识和参数生成规则,因此可以按照事先约定好的参数生成规则生成预设参数,从而将银行端的用户标识和预设参数组装成第一解密参数,接着基于生成的第一解密参数并采用对称加密算法(比如DES算法),对第二秘钥密文进行解密,得到第二SM2公钥,如图2所示。Optionally, step 107 may include: assembling a first decryption parameter according to the user identifier and preset parameters of the bank; Decryption is performed to obtain the second SM2 public key. In the embodiment of the present invention, the bank end and the user end have agreed on the bank end's user ID and parameter generation rules in advance, so the preset parameters can be generated according to the pre-agreed parameter generation rules, so that the bank end user ID and preset parameters can be generated. The parameters are assembled into a first decryption parameter, and then based on the generated first decryption parameter and a symmetric encryption algorithm (such as the DES algorithm), the second secret key ciphertext is decrypted to obtain a second SM2 public key, as shown in Figure 2.

根据上面所述的各种实施例,可以看出本发明实施例通过生成第一SM2公钥及其对应的第一SM2私钥以及生成SM4对称秘钥,然后对第一SM2公钥和SM4对称秘钥进行加密,得到第一秘钥密文,接着将第一秘钥密文发送至用户端的技术手段,解决了现有技术中无法满足用户系统与银行系统之间的安全需求的技术问题。本发明实施例在银企直联系统的基础上,银行端基于SM4对称加解密和SM2数字签名算法,为用户提供身份认证安全,满足了用户系统与银行系统之间的安全需求。According to the various embodiments described above, it can be seen that the embodiment of the present invention generates a first SM2 public key and its corresponding first SM2 private key and generates an SM4 symmetric secret key, and then symmetric to the first SM2 public key and SM4 The technical means of encrypting the secret key to obtain the first secret key ciphertext and then sending the first secret key ciphertext to the user end solves the technical problem that the prior art cannot meet the security requirements between the user system and the banking system. The embodiment of the present invention is based on the bank-enterprise direct connection system, and the bank end is based on the SM4 symmetrical encryption and decryption and the SM2 digital signature algorithm to provide users with identity authentication security and meet the security requirements between the user system and the bank system.

图3是根据本发明第二实施例的文件传输方法的主要流程的示意图。作为本发明的又一个实施例,如图3所示,所述文件传输方法应用于银行端,可以包括:FIG. 3 is a schematic diagram of a main flow of a file transmission method according to a second embodiment of the present invention. As another embodiment of the present invention, as shown in FIG. 3 , the file transfer method is applied to the bank, and may include:

步骤301,接收用户端发送的文件获取请求。Step 301: Receive a file acquisition request sent by a client.

当用户端需要从银行端获取文件时,可以向银行端发送文件获取请求,银行端接收用户端发送的文件获取请求。When the client needs to obtain a file from the bank, it can send a file obtaining request to the bank, and the bank receives the file obtaining request sent by the client.

步骤302,对所述文件获取请求进行验签和解密,得到待传输文件的信息。Step 302: Perform signature verification and decryption on the file acquisition request to obtain information of the file to be transmitted.

银行端对用户端发送的文件获取请求进行验签和解密,从而得到待传输文件的信息,比如待传输文件的名称等。The bank terminal verifies and decrypts the file acquisition request sent by the user terminal, so as to obtain the information of the to-be-transmitted file, such as the name of the to-be-transmitted file.

可选地,步骤302可以包括:采用第二SM2公钥对所述文件获取请求进行验签;若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到待传输文件的信息。由于用户端采用SM2算法对文件进行数字签名,并采用SM4算法对报文进行加密,因此银行端首先采用第二SM2公钥对用户端发送的文件获取请求进行验签,如果验签通过,则采用SM4对称秘钥对验签结果进行解密,得到待传输文件的信息,比如待传输文件的名称等;如果验签不通过,可以向用户端返回验签不通过的结果。Optionally, step 302 may include: using the second SM2 public key to perform signature verification on the file acquisition request; if the signature verification is passed, decrypting the signature verification result using the SM4 symmetric secret key to obtain the signature of the file to be transmitted. information. Since the client uses the SM2 algorithm to digitally sign the file and uses the SM4 algorithm to encrypt the message, the bank first uses the second SM2 public key to verify the signature of the file acquisition request sent by the client. Use the SM4 symmetric key to decrypt the signature verification result to obtain the information of the file to be transmitted, such as the name of the file to be transmitted, etc.; if the signature verification fails, the result that the signature verification fails can be returned to the client.

需要指出的是,银行端也可以采用推送方式向用户端书传输文件,用户端预先订阅相关主题,一旦生成了相关的文件,该文件即为待传输的文件,比如回单文件、到账通知等,这些文件可以采用主动推送的方式传输至用户端。It should be pointed out that the bank can also transfer files to the client by means of push. The client pre-subscribes to the relevant topic. Once the relevant file is generated, the file is the file to be transmitted, such as the receipt file and the account arrival notification. and so on, these files can be transmitted to the client by means of active push.

步骤303,采用所述SM4对称秘钥对所述待传输文件进行加密,得到文件密文。Step 303: Encrypt the to-be-transmitted file by using the SM4 symmetric key to obtain a file ciphertext.

为了保证文件传输的安全性,银行端采用SM4对称秘钥对待传输文件进行加密,得到文件密文。In order to ensure the security of file transmission, the bank uses the SM4 symmetric key to encrypt the file to be transmitted to obtain the ciphertext of the file.

步骤304,采用所述第一SM2私钥对所述文件密文进行数字签名,得到文件签名。Step 304, using the first SM2 private key to digitally sign the file ciphertext to obtain a file signature.

为了进行身份验证,银行端还需要采用第一SM2私钥对文件密文进行数字签名,得到文件签名。For identity verification, the bank also needs to use the first SM2 private key to digitally sign the ciphertext of the file to obtain the file signature.

步骤305,将所述文件签名发送至所述用户端。Step 305: Send the file signature to the client.

最后,银行端将文件签名发送至用户端。Finally, the bank side sends the file signature to the client side.

因此,本发明实施例在银企直联系统的基础上,银行端基于SM4 对称加解密和SM2数字签名算法,为用户提供身份认证安全、安全加密和数字签名等各方面的安全需求,满足了用户系统与银行系统之间的安全需求。Therefore, the embodiment of the present invention is based on the bank-enterprise direct connection system, and the bank end is based on the SM4 symmetric encryption and decryption and the SM2 digital signature algorithm to provide users with various security requirements such as identity authentication security, security encryption, and digital signature, which satisfies the requirements. Security requirements between the user system and the banking system.

图4是根据本发明第三实施例的文件传输方法的主要流程的示意图。作为本发明的再一个实施例,如图4所示,所述文件传输方法应用于用户端,可以包括:FIG. 4 is a schematic diagram of a main flow of a file transmission method according to a third embodiment of the present invention. As yet another embodiment of the present invention, as shown in FIG. 4 , the file transfer method is applied to the client, and may include:

步骤401,向银行端发送秘钥获取请求。In step 401, a request for obtaining a secret key is sent to the bank.

为了能够对银行端发送的数据进行验签和解密,用户端需要从银行端获取秘钥。因此,用户端向银行端发送秘钥获取请求,银行端接收用户端发送的秘钥获取请求。In order to verify and decrypt the data sent by the bank, the client needs to obtain the secret key from the bank. Therefore, the client sends a key acquisition request to the bank, and the bank receives the key acquisition request sent by the client.

步骤402,接收所述银行端返回的第一秘钥密文。Step 402: Receive the first secret key ciphertext returned by the bank.

银行端接收到用户端发送的秘钥获取请求之后,生成第一SM2公钥及其对应的第一SM2私钥,以及SM4对称秘钥,然后对所述第一 SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文,最后将所述第一秘钥密文返回至用户端。用户端接收银行端返回的第一秘钥密文。After receiving the key acquisition request sent by the client, the bank generates a first SM2 public key, its corresponding first SM2 private key, and an SM4 symmetric key, and then symmetric to the first SM2 public key and the SM4 The secret key is encrypted to obtain the first secret key ciphertext, and finally the first secret key ciphertext is returned to the client. The client terminal receives the first secret key ciphertext returned by the bank terminal.

步骤403,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。Step 403: Decrypt the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric secret key.

用户端对银行端返回的第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。可选地,步骤403可以包括:根据所述用户端的用户标识和预设参数,组装成第二解密参数;基于所述第二解密参数并采用对称加密算法,对所述秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。在本发明的实施例中,银行端与用户端事先约定好了用户端的用户标识和参数生成规则,因此可以按照事先约定好的参数生成规则生成预设参数,从而将用户端的用户标识和预设参数组装成第二解密参数,接着基于生成的第二解密参数并采用对称加密算法 (比如DES算法),对第一秘钥密文进行解密,得到第一SM2公钥和 SM4对称秘钥,如图2所示。The user terminal decrypts the first secret key ciphertext returned by the bank terminal to obtain the first SM2 public key and the SM4 symmetric secret key. Optionally, step 403 may include: assembling a second decryption parameter according to the user identifier of the user terminal and preset parameters; decrypting the secret key ciphertext based on the second decryption parameter and using a symmetric encryption algorithm , and obtain the first SM2 public key and SM4 symmetric key. In the embodiment of the present invention, the bank terminal and the user terminal have agreed on the user identification and parameter generation rules of the user terminal in advance, so the preset parameters can be generated according to the pre-agreed parameter generation rules, so as to combine the user identification of the user terminal with the preset parameters. The parameters are assembled into second decryption parameters, and then based on the generated second decryption parameters and a symmetric encryption algorithm (such as the DES algorithm), the first secret key ciphertext is decrypted to obtain the first SM2 public key and SM4 symmetric secret key, such as shown in Figure 2.

步骤404,接收所述银行端发送的秘钥获取请求。Step 404: Receive a key acquisition request sent by the bank.

为了能够对用户端发送的数据进行验签和解密,银行端需要从用户端获取秘钥。因此,银行端向用户端发送秘钥获取请求,用户端接收银行端发送的秘钥获取请求。In order to verify and decrypt the data sent by the client, the bank needs to obtain the secret key from the client. Therefore, the bank terminal sends a key acquisition request to the user terminal, and the user terminal receives the key acquisition request sent by the bank terminal.

步骤405,生成第二SM2公钥及其对应的第二SM2私钥。Step 405, generate a second SM2 public key and its corresponding second SM2 private key.

用户端接收到银行端发送的秘钥获取请求之后,生成第二SM2公钥及其对应的第二SM2私钥。After receiving the key acquisition request sent by the bank, the client generates a second SM2 public key and its corresponding second SM2 private key.

步骤406,对所述第二SM2公钥进行加密,得到第二秘钥密文。Step 406: Encrypt the second SM2 public key to obtain a second secret key ciphertext.

为了安全地传输第二SM2公钥,用户端需要对生成的第二SM2 公钥进行加密,得到第二秘钥密文。In order to securely transmit the second SM2 public key, the client needs to encrypt the generated second SM2 public key to obtain the second secret key ciphertext.

可选地,步骤406可以包括:根据所述银行端的用户标识和预设参数,组装成第二加密参数;基于所述第二加密参数并采用对称加密算法,对所述第二SM2公钥进行加密,得到第二秘钥密文。在本发明的实施例中,银行端与用户端事先约定好了银行端的用户标识和参数生成规则,因此可以按照事先约定好的参数生成规则生成预设参数,从而将银行端的用户标识和预设参数组装成第二加密参数,接着基于生成的第二加密参数并采用对称加密算法(比如DES算法),对第二 SM2公钥进行加密,得到第二秘钥密文。Optionally, step 406 may include: assembling a second encryption parameter according to the user identifier and preset parameters of the bank; Encrypt to get the second key ciphertext. In the embodiment of the present invention, the bank end and the user end have agreed on the bank end's user ID and parameter generation rules in advance, so the preset parameters can be generated according to the pre-agreed parameter generation rules, so that the bank end user ID and preset parameters can be generated. The parameters are assembled into second encryption parameters, and then based on the generated second encryption parameters and using a symmetric encryption algorithm (such as a DES algorithm), the second SM2 public key is encrypted to obtain a second secret key ciphertext.

步骤407,将所述第二秘钥密文发送至所述银行端。Step 407: Send the second secret key ciphertext to the bank.

如图2所示,用户端将加密后的第二秘钥密文发送至用户端,银行端对其进行解密后,就可以获取用户端的第二SM2公钥。As shown in Figure 2, the client sends the encrypted second secret key ciphertext to the client, and after the bank decrypts it, the client's second SM2 public key can be obtained.

因此,本发明实施例在银企直联系统的基础上,银行端基于SM4 对称加解密和SM2数字签名算法,为用户提供身份认证安全、安全加密和数字签名等各方面的安全需求,满足了用户系统与银行系统之间的安全需求。图5是根据本发明第四实施例的文件传输方法的主要流程的示意图。作为本发明的另一个实施例,如图5所示,所述文件传输方法应用于用户端,可以包括:Therefore, the embodiment of the present invention is based on the bank-enterprise direct connection system, and the bank end is based on the SM4 symmetric encryption and decryption and the SM2 digital signature algorithm to provide users with various security requirements such as identity authentication security, security encryption, and digital signature, which satisfies the requirements. Security requirements between the user system and the banking system. FIG. 5 is a schematic diagram of a main flow of a file transmission method according to a fourth embodiment of the present invention. As another embodiment of the present invention, as shown in FIG. 5 , the file transfer method is applied to the user terminal, and may include:

步骤501,根据待传输文件的信息生成报文。Step 501: Generate a message according to the information of the file to be transmitted.

当用户端需要从银行端获取文件时,根据待传输文件的信息(比如待传输文件的名称)生成报文可以。When the client needs to obtain a file from the bank, it can generate a message according to the information of the file to be transferred (such as the name of the file to be transferred).

步骤502,采用所述第二SM2私钥对所述报文进行加密,得到报文密文。Step 502: Encrypt the message by using the second SM2 private key to obtain a message ciphertext.

为了保证安全性,用户端采用第二SM2私钥对报文进行加密,得到报文密文。To ensure security, the client uses the second SM2 private key to encrypt the message to obtain the ciphertext of the message.

步骤503,采用所述SM4对称秘钥对所述报文密文进行数字验签,得到报文签名。Step 503: Digitally verify the ciphertext of the message by using the SM4 symmetric key to obtain a message signature.

为了进行身份验证,用户端还需要采用SM4对称秘钥对报文密文进行数字验签,得到报文签名。In order to perform identity verification, the client also needs to use the SM4 symmetric key to digitally verify the ciphertext of the message to obtain the message signature.

步骤504,向所述银行端发送文件获取请求,所述文件获取请求携带所述报文签名。Step 504: Send a file acquisition request to the bank, where the file acquisition request carries the message signature.

步骤505,接收所述银行端返回的文件签名。Step 505: Receive the file signature returned by the bank.

步骤506,采用所述第一SM2公钥对所述文件签名进行验签。Step 506, using the first SM2 public key to verify the file signature.

步骤507,若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到文件。Step 507, if the signature verification is passed, use the SM4 symmetric key to decrypt the signature verification result to obtain a file.

图6是根据本发明第一实施例的文件传输装置的主要模块的示意图。如图6所示,所述文件传输装置600设置于银行端,包括第一接收模块601、第一秘钥模块602、第一加密模块603、第一发送模块604 和第一解密模块605;其中,第一接收模块601用于接收用户端发送的秘钥获取请求;接收所述用户端返回的第二秘钥密文;第一秘钥模块 602用于生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4 对称秘钥;第一加密模块603,用于对所述第一SM2公钥和所述SM4 对称秘钥进行加密,得到第一秘钥密文;第一发送模块604用于将所述第一秘钥密文发送至所述用户端;向所述用户端发送秘钥获取请求;第一解密模块605用于对所述第二秘钥密文进行解密,得到第二SM2 公钥。FIG. 6 is a schematic diagram of the main modules of the file transmission apparatus according to the first embodiment of the present invention. As shown in FIG. 6, the file transmission device 600 is set at the bank end, and includes a first receiving module 601, a first secret key module 602, a first encryption module 603, a first sending module 604 and a first decryption module 605; wherein , the first receiving module 601 is used to receive the key acquisition request sent by the client; receive the second secret key ciphertext returned by the client; the first secret key module 602 is used to generate the first SM2 public key and its corresponding The first SM2 private key, and the SM4 symmetric secret key; the first encryption module 603 is used for encrypting the first SM2 public key and the SM4 symmetric secret key to obtain the first secret key ciphertext; the first The sending module 604 is configured to send the first secret key ciphertext to the client; send a secret key acquisition request to the client; the first decryption module 605 is configured to decrypt the second secret key ciphertext , get the second SM2 public key.

可选地,所述第一加密模块603还用于:Optionally, the first encryption module 603 is also used for:

根据所述用户端的用户标识和预设参数,组装成第一加密参数;According to the user identification and preset parameters of the user terminal, the first encryption parameter is assembled;

基于所述第一加密参数并采用对称加密算法,对所述第一SM2公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文。Based on the first encryption parameter and using a symmetric encryption algorithm, encrypt the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.

可选地,所述第一解密模块605还用于:Optionally, the first decryption module 605 is also used for:

根据所述银行端的用户标识和预设参数,组装成第一解密参数;According to the user identification and preset parameters of the bank terminal, the first decryption parameter is assembled;

基于所述第一解密参数并采用对称加密算法,对所述第二秘钥密文进行解密,得到第二SM2公钥。Based on the first decryption parameter and using a symmetric encryption algorithm, the second secret key ciphertext is decrypted to obtain a second SM2 public key.

可选地,所述第一接收模块601还用于接收用户端发送的文件获取请求;Optionally, the first receiving module 601 is further configured to receive a file acquisition request sent by the client;

所述第一解密模块还用于对所述文件获取请求进行验签和解密,得到待传输文件的信息;The first decryption module is also used to perform signature verification and decryption on the file acquisition request to obtain the information of the file to be transmitted;

所述第一加密模块603还用于采用所述SM4对称秘钥对所述待传输文件进行加密,得到文件密文;采用所述第一SM2私钥对所述文件密文进行数字签名,得到文件签名;The first encryption module 603 is further configured to encrypt the file to be transmitted by using the SM4 symmetric key to obtain a file ciphertext; use the first SM2 private key to digitally sign the file ciphertext to obtain document signature;

所述第一发送模块604还用于将所述文件签名发送至所述用户端。The first sending module 604 is further configured to send the file signature to the client.

可选地,所述第一解密模块还用于:Optionally, the first decryption module is also used for:

采用第二SM2公钥对所述文件获取请求进行验签;Use the second SM2 public key to verify the signature of the file acquisition request;

若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到待传输文件的信息。If the signature verification is passed, the signature verification result is decrypted by using the SM4 symmetric key to obtain the information of the file to be transmitted.

需要说明的是,在本发明所述文件传输装置的具体实施内容,在上面所述文件传输方法中已经详细说明了,故在此重复内容不再说明。It should be noted that the specific implementation content of the file transmission device of the present invention has been described in detail in the above-mentioned file transmission method, so the repeated content will not be described here.

图7是根据本发明第一实施例的文件传输装置的主要模块的示意图。如图7所示,所述文件传输装置700设置于用户端,包括第二发送模块701、第二接收模块702和、第二解密模块703、第二秘钥模块 704和第二加密模块705;其中,第二发送模块701用于向银行端发送秘钥获取请求;将所述第二秘钥密文发送至所述银行端;第二接收模块702用于接收所述银行端返回的第一秘钥密文;接收所述银行端发送的秘钥获取请求;第二解密模块703用于对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥;第二秘钥模块704用于生成第二SM2公钥及其对应的第二SM2私钥;第二加密模块705用于对所述第二SM2公钥进行加密,得到第二秘钥密文。FIG. 7 is a schematic diagram of the main modules of the file transmission apparatus according to the first embodiment of the present invention. As shown in FIG. 7 , the file transmission device 700 is set at the user end, and includes a second sending module 701, a second receiving module 702, a second decrypting module 703, a second secret key module 704, and a second encryption module 705; Wherein, the second sending module 701 is configured to send a key acquisition request to the bank; send the second secret key ciphertext to the bank; and the second receiving module 702 is configured to receive the first returned by the bank secret key ciphertext; receive the secret key acquisition request sent by the bank; the second decryption module 703 is used to decrypt the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric secret key; the second The secret key module 704 is used for generating the second SM2 public key and the corresponding second SM2 private key; the second encryption module 705 is used for encrypting the second SM2 public key to obtain the second secret key ciphertext.

可选地,所述第二解密模块703还用于:Optionally, the second decryption module 703 is also used for:

根据所述用户端的用户标识和预设参数,组装成第二解密参数;According to the user identification and preset parameters of the user terminal, the second decryption parameter is assembled;

基于所述第二解密参数并采用对称加密算法,对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4对称秘钥。Based on the second decryption parameter and using a symmetric encryption algorithm, the first secret key ciphertext is decrypted to obtain the first SM2 public key and the SM4 symmetric secret key.

可选地,所述第二加密模块705还用于:Optionally, the second encryption module 705 is also used for:

根据所述银行端的用户标识和预设参数,组装成第二加密参数;According to the user identification and preset parameters of the bank end, the second encryption parameter is assembled;

基于所述第二加密参数并采用对称加密算法,对所述第二SM2公钥进行加密,得到第二秘钥密文。Encrypting the second SM2 public key based on the second encryption parameter and using a symmetric encryption algorithm to obtain a second secret key ciphertext.

可选地,所述第二加密模块705还用于:根据待传输文件的信息生成报文;采用所述第二SM2私钥对所述报文进行加密,得到报文密文;采用所述SM4对称秘钥对所述报文密文进行数字验签,得到报文签名;Optionally, the second encryption module 705 is further configured to: generate a message according to the information of the file to be transmitted; use the second SM2 private key to encrypt the message to obtain a message ciphertext; use the The SM4 symmetric key performs digital signature verification on the ciphertext of the message to obtain a message signature;

所述第二发送模块701还用于向所述银行端发送文件获取请求,所述文件获取请求携带所述报文签名。The second sending module 701 is further configured to send a file acquisition request to the bank, where the file acquisition request carries the message signature.

可选地,所述第二接收模块702还用于接收所述银行端返回的文件签名;Optionally, the second receiving module 702 is further configured to receive the file signature returned by the bank;

所述第二解密模块703还用于:采用所述第一SM2公钥对所述文件签名进行验签;若验签通过,则采用所述SM4对称秘钥对验签结果进行解密,得到文件。The second decryption module 703 is further configured to: verify the signature of the file by using the first SM2 public key; if the signature is verified, decrypt the verification result by using the SM4 symmetric secret key to obtain the file .

需要说明的是,在本发明所述文件传输装置的具体实施内容,在上面所述文件传输方法中已经详细说明了,故在此重复内容不再说明。It should be noted that the specific implementation content of the file transmission device of the present invention has been described in detail in the above-mentioned file transmission method, so the repeated content will not be described here.

图8示出了可以应用本发明实施例的文件传输方法或文件传输装置的示例性系统架构800。FIG. 8 shows an exemplary system architecture 800 to which a file transfer method or a file transfer apparatus according to an embodiment of the present invention may be applied.

如图8所示,系统架构800可以包括终端设备801、802、803,网络804和服务器805。网络804用以在终端设备801、802、803和服务器805之间提供通信链路的介质。网络804可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 8 , the system architecture 800 may include terminal devices 801 , 802 , and 803 , a network 804 and a server 805 . The network 804 is a medium used to provide a communication link between the terminal devices 801 , 802 , 803 and the server 805 . Network 804 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备801、802、803通过网络804与服务器805 交互,以接收或发送消息等。终端设备801、802、803上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages and the like. Various communication client applications may be installed on the terminal devices 801 , 802 and 803 , such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

终端设备801、802、803可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

服务器805可以是提供各种服务的服务器,例如对用户利用终端设备801、802、803所浏览的购物类网站提供支持的后台管理服务器 (仅为示例)。后台管理服务器可以对接收到的物品信息查询请求等数据进行分析等处理,并将处理结果反馈给终端设备。The server 805 may be a server that provides various services, for example, a background management server that provides support for shopping websites browsed by the terminal devices 801, 802, and 803 (just an example). The background management server can analyze and process the received item information query request and other data, and feed back the processing result to the terminal device.

需要说明的是,本发明实施例所提供的文件传输方法一般由服务器805执行,相应地,所述文件传输装置一般设置在服务器805中。It should be noted that the file transmission method provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the file transmission apparatus is generally set in the server 805 .

应该理解,图8中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 8 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.

下面参考图9,其示出了适于用来实现本发明实施例的终端设备的计算机系统900的结构示意图。图9示出的终端设备仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。Referring next to FIG. 9 , it shows a schematic structural diagram of a computer system 900 suitable for implementing a terminal device according to an embodiment of the present invention. The terminal device shown in FIG. 9 is only an example, and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.

如图9所示,计算机系统900包括中央处理单元(CPU)901,其可以根据存储在只读存储器(ROM)902中的程序或者从存储部分908 加载到随机访问存储器(RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有系统900操作所需的各种程序和数据。CPU 901、ROM 902以及RAM903通过总线904彼此相连。输入/ 输出(I/O)接口905也连接至总线904。As shown in FIG. 9, a computer system 900 includes a central processing unit (CPU) 901, which can be loaded into a random access memory (RAM) 903 according to a program stored in a read only memory (ROM) 902 or a program from a storage section 908 Instead, various appropriate actions and processes are performed. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901 , the ROM 902 , and the RAM 903 are connected to each other through a bus 904 . An input/output (I/O) interface 905 is also connected to bus 904 .

以下部件连接至I/O接口905:包括键盘、鼠标等的输入部分906;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分907;包括硬盘等的存储部分908;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分909。通信部分909经由诸如因特网的网络执行通信处理。驱动器910也根据需要连接至I/O接口905。可拆卸介质911,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器910上,以便于从其上读出的计算机程序根据需要被安装入存储部分908。The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc. ; and a communication section 909 including a network interface card such as a LAN card, a modem, and the like. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.

特别地,根据本发明公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明公开的实施例包括一种计算机程序,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分909从网络上被下载和安装,和/ 或从可拆卸介质911被安装。在该计算机程序被中央处理单元(CPU) 901执行时,执行本发明的系统中限定的上述功能。In particular, the processes described above with reference to the flowcharts may be implemented as computer software programs in accordance with the disclosed embodiments of the present invention. For example, embodiments disclosed herein include a computer program comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication section 909 and/or installed from the removable medium 911 . When the computer program is executed by the central processing unit (CPU) 901, the above-described functions defined in the system of the present invention are performed.

需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented in special purpose hardware-based systems that perform the specified functions or operations, or can be implemented using A combination of dedicated hardware and computer instructions is implemented.

描述于本发明实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括第一接收模块、第一秘钥模块、第一加密模块和第一发送模块,其中,这些模块的名称在某种情况下并不构成对该模块本身的限定。The modules involved in the embodiments of the present invention may be implemented in a software manner, and may also be implemented in a hardware manner. The described module can also be set in the processor, for example, it can be described as: a processor includes a first receiving module, a first key module, a first encryption module and a first sending module, wherein the names of these modules are In some cases, it does not constitute a limitation of the module itself.

描述于本发明实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括第二发送模块、第二接收模块和第二解密模块,其中,这些模块的名称在某种情况下并不构成对该模块本身的限定。The modules involved in the embodiments of the present invention may be implemented in a software manner, and may also be implemented in a hardware manner. The described modules can also be provided in the processor, for example, it can be described as: a processor includes a second sending module, a second receiving module and a second decrypting module, wherein the names of these modules are in some cases the same It does not constitute a limitation on the module itself.

作为另一方面,本发明还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,该设备实现如下方法:接收用户端发送的秘钥获取请求;生成第一SM2公钥及其对应的第一SM2私钥,以及,生成SM4对称秘钥;对所述第一SM2 公钥和所述SM4对称秘钥进行加密,得到第一秘钥密文;将所述第一秘钥密文发送至所述用户端。As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or may exist alone without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by a device, the device implements the following methods: receiving a key acquisition request sent by a user terminal; generating a first SM2 public key and Its corresponding first SM2 private key, and generating an SM4 symmetric key; encrypting the first SM2 public key and the SM4 symmetric key to obtain a first key ciphertext; The ciphertext is sent to the client.

作为另一方面,本发明还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,该设备实现如下方法:向银行端发送秘钥获取请求;接收所述银行端返回的第一秘钥密文;对所述第一秘钥密文进行解密,得到第一SM2公钥和SM4 对称秘钥。As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or may exist alone without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by a device, the device implements the following methods: sending a key acquisition request to the bank; a secret key ciphertext; decrypt the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric secret key.

作为另一方面,本发明实施例还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述任一实施例所述的方法。As another aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which implements the method described in any of the foregoing embodiments when the computer program is executed by a processor.

根据本发明实施例的技术方案,因为采用生成第一SM2公钥及其对应的第一SM2私钥以及生成SM4对称秘钥,然后对第一SM2公钥和SM4对称秘钥进行加密,得到第一秘钥密文,接着将第一秘钥密文发送至用户端的技术手段,所以克服了现有技术中无法满足用户系统与银行系统之间的安全需求的技术问题。本发明实施例在银企直联系统的基础上,银行端基于SM4对称加解密和SM2数字签名算法,为用户提供身份认证安全、安全加密和数字签名等各方面的安全需求,满足了用户系统与银行系统之间的安全需求。According to the technical solution of the embodiment of the present invention, because the generation of the first SM2 public key and the corresponding first SM2 private key and the generation of the SM4 symmetric secret key are adopted, and then the first SM2 public key and the SM4 symmetric secret key are encrypted, the first SM2 public key and the SM4 symmetric secret key are encrypted. The technical means of sending the first secret key ciphertext to the user end after one secret key ciphertext, thus overcomes the technical problem that the prior art cannot meet the security requirements between the user system and the banking system. The embodiment of the present invention is based on the bank-enterprise direct connection system, and the bank end is based on the SM4 symmetric encryption and decryption and the SM2 digital signature algorithm to provide users with various security requirements such as identity authentication security, security encryption, and digital signatures, and satisfies the user system. Security requirements with the banking system.

上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (23)

1. A file transmission method is applied to a bank end and comprises the following steps:
receiving a secret key acquisition request sent by a user side;
generating a first SM2 public key and a corresponding first SM2 private key thereof, and generating an SM4 symmetric key;
encrypting the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext;
sending the first secret key ciphertext to the user side;
sending a key acquisition request to the user side;
receiving a second secret key ciphertext returned by the user side;
and decrypting the second secret key ciphertext to obtain a second SM2 public key.
2. The method of claim 1, wherein encrypting the first SM2 public key and the SM4 symmetric key to obtain a first secret key ciphertext comprises:
assembling a first encryption parameter according to the user identifier of the user side and a preset parameter;
and based on the first encryption parameter and by adopting a symmetric encryption algorithm, encrypting the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.
3. The method of claim 1, wherein decrypting the second secret key ciphertext to obtain a second SM2 public key comprises:
assembling a first decryption parameter according to the user identification and the preset parameter of the bank end;
and decrypting the second secret key ciphertext by adopting a symmetric encryption algorithm based on the first decryption parameter to obtain a second SM2 public key.
4. The method of claim 1, wherein after decrypting the second secret key ciphertext to obtain a second SM2 public key, further comprising:
receiving a file acquisition request sent by a user side;
performing signature verification and decryption on the file acquisition request to obtain information of the file to be transmitted;
encrypting the file to be transmitted by using the SM4 symmetric key to obtain a file ciphertext;
performing digital signature on the file ciphertext by using the first SM2 private key to obtain a file signature;
and sending the file signature to the user side.
5. The method of claim 4, wherein signing and decrypting the file retrieval request comprises:
adopting a second SM2 public key to check the file acquisition request;
and if the signature passes the verification, decrypting the signature verification result by using the SM4 symmetric key to obtain the information of the file to be transmitted.
6. A file transmission method is applied to a user side and comprises the following steps:
sending a secret key acquisition request to a bank end;
receiving a first secret key ciphertext returned by the bank end;
decrypting the first secret key ciphertext to obtain a first SM2 public key and an SM4 symmetric secret key;
receiving a secret key acquisition request sent by the bank end;
generating a second SM2 public key and its corresponding second SM2 private key;
encrypting the second SM2 public key to obtain a second secret key ciphertext;
and sending the second secret key ciphertext to the bank end.
7. The method of claim 6, wherein decrypting the first secret key ciphertext to obtain a first SM2 public key and an SM4 symmetric key comprises:
assembling into a second decryption parameter according to the user identifier of the user side and a preset parameter;
and decrypting the first secret key ciphertext by adopting a symmetric encryption algorithm based on the second decryption parameter to obtain a first SM2 public key and an SM4 symmetric secret key.
8. The method of claim 6, wherein encrypting the second SM2 public key to obtain a second secret key ciphertext comprises:
assembling a second encryption parameter according to the user identification and the preset parameter of the bank end;
and encrypting the second SM2 public key based on the second encryption parameter by adopting a symmetric encryption algorithm to obtain a second secret key ciphertext.
9. The method of claim 6, wherein after decrypting the first secret key ciphertext to obtain the first SM2 public key and the SM4 symmetric key, further comprising:
generating a message according to the information of the file to be transmitted;
encrypting the message by using the second SM2 private key to obtain a message ciphertext;
performing digital signature verification on the message ciphertext by using the SM4 symmetric key to obtain a message signature;
and sending a file acquisition request to the bank terminal, wherein the file acquisition request carries the message signature.
10. The method according to claim 9, after sending the file acquisition request to the bank terminal, further comprising:
receiving a file signature returned by the bank end;
verifying the file signature by using the first SM2 public key;
and if the signature passes the verification, decrypting the signature verification result by using the SM4 symmetric key to obtain the file.
11. The utility model provides a file transmission device which characterized in that sets up in bank end, includes:
the first receiving module is used for receiving a secret key obtaining request sent by a user side; receiving a second secret key ciphertext returned by the user side;
the first secret key module is used for generating a first SM2 public key and a corresponding first SM2 private key thereof, and generating an SM4 symmetric secret key;
the first encryption module is configured to encrypt the first SM2 public key and the SM4 symmetric key to obtain a first secret key ciphertext;
the first sending module is used for sending the first secret key ciphertext to the user side; sending a key acquisition request to the user side;
and the first decryption module is used for decrypting the second secret key ciphertext to obtain a second SM2 public key.
12. The apparatus of claim 11, wherein the first encryption module is further configured to:
assembling a first encryption parameter according to the user identifier of the user side and a preset parameter;
and based on the first encryption parameter and by adopting a symmetric encryption algorithm, encrypting the first SM2 public key and the SM4 symmetric secret key to obtain a first secret key ciphertext.
13. The apparatus of claim 11, wherein the first decryption module is further configured to:
assembling a first decryption parameter according to the user identification and the preset parameter of the bank end;
and decrypting the second secret key ciphertext by adopting a symmetric encryption algorithm based on the first decryption parameter to obtain a second SM2 public key.
14. The apparatus according to claim 11, wherein the first receiving module is further configured to receive a file obtaining request sent by a user side;
the first decryption module is further used for carrying out signature verification and decryption on the file acquisition request to obtain information of the file to be transmitted;
the first encryption module is further configured to encrypt the file to be transmitted by using the SM4 symmetric key to obtain a file ciphertext; performing digital signature on the file ciphertext by using the first SM2 private key to obtain a file signature;
the first sending module is further configured to send the file signature to the user side.
15. The apparatus of claim 14, wherein the first decryption module is further configured to:
adopting a second SM2 public key to check the file acquisition request;
and if the signature passes the verification, decrypting the signature verification result by using the SM4 symmetric key to obtain the information of the file to be transmitted.
16. The utility model provides a file transmission device which characterized in that sets up in the user side, includes:
the second sending module is used for sending a secret key obtaining request to the bank end; sending the second secret key ciphertext to the bank end;
the second receiving module is used for receiving a first secret key ciphertext returned by the bank end; receiving a secret key acquisition request sent by the bank end;
the second decryption module is used for decrypting the first secret key ciphertext to obtain a first SM2 public key and an SM4 symmetric secret key;
the second secret key module is used for generating a second SM2 public key and a corresponding second SM2 private key;
and the second encryption module is used for encrypting the second SM2 public key to obtain a second secret key ciphertext.
17. The apparatus of claim 16, wherein the second decryption module is further configured to:
assembling into a second decryption parameter according to the user identifier of the user side and a preset parameter;
and decrypting the first secret key ciphertext by adopting a symmetric encryption algorithm based on the second decryption parameter to obtain a first SM2 public key and an SM4 symmetric secret key.
18. The apparatus of claim 16, wherein the second encryption module is further configured to:
assembling a second encryption parameter according to the user identification and the preset parameter of the bank end;
and encrypting the second SM2 public key based on the second encryption parameter by adopting a symmetric encryption algorithm to obtain a second secret key ciphertext.
19. The apparatus of claim 16, wherein the second encryption module is further configured to: generating a message according to the information of the file to be transmitted; encrypting the message by using the second SM2 private key to obtain a message ciphertext; performing digital signature verification on the message ciphertext by using the SM4 symmetric key to obtain a message signature;
the second sending module is further configured to send a file obtaining request to the bank end, where the file obtaining request carries the message signature.
20. The apparatus according to claim 19, wherein the second receiving module is further configured to receive a file signature returned by the bank end;
the second decryption module is further configured to: verifying the file signature by using the first SM2 public key; and if the signature passes the verification, decrypting the signature verification result by using the SM4 symmetric key to obtain the file.
21. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-10.
22. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
23. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-10 when executed by a processor.
CN202111590677.1A 2021-12-23 2021-12-23 File transmission method and device, electronic equipment and computer readable medium Pending CN114417369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111590677.1A CN114417369A (en) 2021-12-23 2021-12-23 File transmission method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111590677.1A CN114417369A (en) 2021-12-23 2021-12-23 File transmission method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN114417369A true CN114417369A (en) 2022-04-29

Family

ID=81268160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111590677.1A Pending CN114417369A (en) 2021-12-23 2021-12-23 File transmission method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN114417369A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114938273A (en) * 2022-05-24 2022-08-23 杭州萤石软件有限公司 Key negotiation method, system, sending end and receiving end
CN116405199A (en) * 2023-03-07 2023-07-07 中国农业银行股份有限公司 Encryption method, device, equipment and medium based on NTRU algorithm and SM2 algorithm

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055236A (en) * 2017-11-03 2018-05-18 深圳市轱辘车联数据技术有限公司 A kind of data processing method, mobile unit and electronic equipment
CN109257347A (en) * 2018-09-10 2019-01-22 中国建设银行股份有限公司 Communication means and relevant apparatus, storage medium suitable for data interaction between bank
CN111355683A (en) * 2018-12-20 2020-06-30 航天信息股份有限公司 Method, device and storage medium for ensuring http data transmission safety
EP3817323A1 (en) * 2019-11-01 2021-05-05 Fujitsu Limited Encryption processing system, encryption processing method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055236A (en) * 2017-11-03 2018-05-18 深圳市轱辘车联数据技术有限公司 A kind of data processing method, mobile unit and electronic equipment
CN109257347A (en) * 2018-09-10 2019-01-22 中国建设银行股份有限公司 Communication means and relevant apparatus, storage medium suitable for data interaction between bank
CN111355683A (en) * 2018-12-20 2020-06-30 航天信息股份有限公司 Method, device and storage medium for ensuring http data transmission safety
EP3817323A1 (en) * 2019-11-01 2021-05-05 Fujitsu Limited Encryption processing system, encryption processing method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114938273A (en) * 2022-05-24 2022-08-23 杭州萤石软件有限公司 Key negotiation method, system, sending end and receiving end
CN116405199A (en) * 2023-03-07 2023-07-07 中国农业银行股份有限公司 Encryption method, device, equipment and medium based on NTRU algorithm and SM2 algorithm

Similar Documents

Publication Publication Date Title
CN111371549B (en) Message data transmission method, device and system
CN113347206B (en) Network access method and device
CN104917741B (en) A kind of plain text document public network secure transmission system based on USBKEY
CN108965230A (en) A kind of safety communicating method, system and terminal device
CN114650181B (en) E-mail encryption and decryption method, system, device and computer-readable storage medium
CN116112172B (en) Android client gRPC interface security verification method and device
WO2020252611A1 (en) Data interaction method and related equipments
CN111784887A (en) A method, device and system for authorization and release of user access
CN112437044B (en) Instant messaging method and device
CN110149354A (en) An encryption authentication method and device based on https protocol
CN115567263A (en) A data transmission management method, data processing method and device
CN110519203A (en) A kind of data encryption and transmission method and device
CN116707778A (en) Data mixed encrypted transmission method, device and electronic equipment
CN111181920A (en) Encryption and decryption method and device
CN112966287B (en) Method, system, device and computer readable medium for acquiring user data
CN118611920A (en) Electronic tender document processing method, device, electronic device and storage medium
CN114417369A (en) File transmission method and device, electronic equipment and computer readable medium
CN114037447B (en) Offline transaction method and device
CN103873245B (en) Dummy machine system data ciphering method and equipment
CN111526128B (en) Encryption management method and device
CN106453069B (en) An instant messaging message sending, viewing, viewing control method and device thereof
CN110098921A (en) Verification code generation method, device, application service end and system
EP4485858A1 (en) Security authentication method, apparatus and system for digital currency transaction
CN110166226B (en) A method and device for generating a secret key
CN107707528B (en) Method and device for isolating user information

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