A file transmission method and device, electronic equipment and storage medium

By generating user key pairs using an asymmetric encryption algorithm and verifying the server-side identity using a digital certificate, the problem of low efficiency and security in encrypted file transfer methods is solved, achieving more efficient and secure file transfer.

CN116866333BActive Publication Date: 2026-11-24SHENZHEN STORLEAD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310794086.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-11-24
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

Existing encrypted file transfer methods suffer from low efficiency and security, especially in large file transfers and multiple encryption operations, which limits the scope of use of network transmission protocols and poses a risk of key leakage.

Method used

Asymmetric encryption algorithms are used to generate user key pairs. The server-side identity is verified through digital certificates, and file requests are encrypted using the user's public key. This reduces the encryption process and ensures the security of authentication and file transfer.

Benefits of technology

It improves the security and efficiency of file transfer, prevents key leakage, avoids the risk of file loss due to identical keys, and optimizes the security and speed of encrypted file transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116866333B_ABST
    Figure CN116866333B_ABST
Patent Text Reader

Abstract

This invention relates to the field of secure transmission technology, disclosing a method, apparatus, electronic device, and storage medium for encrypted file transmission. The specific implementation scheme is as follows: a user requests and verifies a digital certificate from a server; the user generates a public-private key pair, encrypts it using the server's public key, and sends it to the server; the server encrypts the file during its idle time; the user encrypts the request using their private key; the server decrypts the request and locates the corresponding pre-encrypted file, encrypts the key with the user's public key, and sends it to the user; the user decrypts the file and performs an integrity check on the original file. This invention improves the efficiency and security of encrypted file transmission methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of secure transmission technology, and in particular to an encrypted file transmission method, apparatus, electronic device, and storage medium. Background Technology

[0002] To ensure data security, an increasing number of websites are adopting HTTPS (Hypertext Transfer Protocol) for file transfer. HTTPS uses symmetric encryption to encrypt transmitted files and asymmetric encryption algorithms for authentication, balancing security and encryption efficiency. However, HTTPS has some drawbacks. Each file transfer requires encryption, which can lead to lengthy encryption times for large or frequently accessed files, resulting in low efficiency and severely limiting its applicability. With the widespread adoption of HTTPS, its file encryption shortcomings have become increasingly apparent. For example, after the initial exchange of symmetric encryption keys between the user and the system, the key is stored in the user's browser cookie (local terminal storage data). Subsequent file transfers use the same symmetric encryption key for encryption and decryption, creating significant security risks. Furthermore, the key stored in the browser's cookie is easily leaked. Additionally, HTTPS requires two separate encryption and decryption operations per file transfer, which is particularly problematic for servers that typically serve multiple users simultaneously; the extended encryption time significantly restricts service efficiency. In summary, existing encrypted file transfer methods suffer from low efficiency and low security. Summary of the Invention

[0003] This invention provides a method, apparatus, electronic device, and storage medium for encrypted file transfer, the main purpose of which is to solve the problems of low efficiency and low security in encrypted file transfer methods.

[0004] To achieve the above objectives, the present invention provides an encrypted file transfer method applied to a user terminal, comprising: sending a certificate verification request to a server; receiving a digital certificate returned by the server based on the certificate verification request, verifying the server's identity based on the digital certificate, and obtaining an authentication result; when the authentication result is secure, generating a user key pair using an asymmetric encryption algorithm based on the digital certificate; encrypting the user public key in the user key pair using the server public key in the digital certificate to obtain an encrypted public key, and sending the encrypted public key to the server; encrypting a generated file request using the user private key in the user key pair to obtain an encrypted request, and sending the encrypted request to the server; receiving a response file returned by the server based on the encrypted public key and the encrypted request, decrypting the response file to obtain the original response file; and performing signature verification on the original response file to obtain a signature verification result.

[0005] To achieve the above objectives, the present invention provides an encrypted file transfer method applied on a server side, comprising: after receiving a certificate verification request sent by a user terminal, sending a digital certificate to the user terminal; wherein the digital certificate is used by the user terminal for identity verification to obtain an identity verification result; receiving an encryption public key sent by the user terminal, decrypting the encryption public key to obtain a user public key; wherein the encryption public key is obtained by the user terminal encrypting the user public key in a user key pair generated based on the digital certificate using an asymmetric encryption algorithm when the identity verification result is secure; receiving an encryption request sent by the user terminal, and obtaining a response file to be processed according to the encryption request; wherein the encryption request is obtained by the user terminal encrypting a generated file request using the user private key in the user key pair; encrypting the response file to be processed according to the user public key to obtain a response file, and sending the response file to the user terminal; wherein the response file is used by the user terminal to decrypt to obtain the original response file, and the original response file is used by the user terminal for signature verification to obtain a signature verification result.

[0006] This invention also provides an encrypted file transfer device applied to a user terminal, comprising: an authentication module for sending a certificate verification request to a server, receiving a digital certificate returned by the server based on the certificate verification request, authenticating the server based on the digital certificate, and obtaining an authentication result; an encryption public key generation module for generating a user key pair using an asymmetric encryption algorithm based on the digital certificate when the authentication result is secure, encrypting the user public key in the user key pair using the server public key in the digital certificate, obtaining an encryption public key, and sending the encryption public key to the server; a file request encryption module for encrypting a generated file request using the user private key in the user key pair, obtaining an encrypted request, and sending the encrypted request to the server; a response file decryption module for receiving a response file returned by the server based on the encryption public key and the encryption request, decrypting the response file, and obtaining the original response file; and a signature verification module for verifying the signature of the original response file and obtaining a signature verification result.

[0007] This invention also provides an encrypted file transfer device applied on a server side, comprising: a digital certificate sending module, used to send a digital certificate to the user terminal after receiving a certificate verification request sent by the user terminal; wherein the digital certificate is used by the user terminal for identity verification to obtain an identity verification result; an encryption public key decryption module, used to receive an encryption public key sent by the user terminal, decrypt the encryption public key to obtain a user public key; wherein the encryption public key is obtained by the user terminal using an asymmetric encryption algorithm to encrypt the user public key in the user key pair generated by the digital certificate when the identity verification result is secure; a pending response file acquisition module, used to receive an encryption request sent by the user terminal, and acquire a pending response file according to the encryption request; wherein the encryption request is obtained by the user terminal encrypting a generated file request using the user private key in the user key pair; and a response file generation module, used to encrypt the pending response file according to the user public key to obtain a response file, and send the response file to the user terminal; wherein the response file is used by the user terminal to decrypt to obtain the original response file, and the original response file is used by the user terminal for signature verification to obtain a signature verification result.

[0008] The present invention also provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the processor is configured to execute a first computer program or a second computer program stored in the memory; when the processor executes the first computer program, it implements the steps of the encrypted file transfer method applied to a user terminal; when the processor executes the second computer program, it implements the steps of the encrypted file transfer method applied to a server terminal.

[0009] The present invention also provides a computer-readable storage medium storing a computer program, characterized in that it stores a first computer program or a second computer program thereon, characterized in that, when the first computer program is executed by a processor, it implements the steps in the encrypted file transfer method applied to the user end; when the second computer program is executed by a processor, it implements the steps in the encrypted file transfer method applied to the server end.

[0010] This invention proposes an encrypted file transfer method. When a user initiates a request, the user's private key is used to encrypt the file request. The server verifies the user's identity using the user's public key, preventing impersonation and improving file transfer security. Encrypting the response file to be processed using the user's public key reduces the encryption process and speeds up file transfer. For multiple interactions between the user and server, different files use different encryption keys. This prevents the loss of all files in the event of key leakage, reducing the risk of file leakage and further enhancing transfer security. Therefore, the encrypted file transfer method, apparatus, electronic device, and storage medium proposed in this invention can solve the problems of low efficiency and security in existing encrypted file transfer methods. Attached Figure Description

[0011] Figure 1 A schematic diagram of the signaling flow of an encrypted file transfer method provided in an embodiment of the present invention;

[0012] Figure 2 This is a flowchart illustrating an encrypted file transfer method applied to a user terminal according to an embodiment of the present invention.

[0013] Figure 3 This is a schematic diagram illustrating the interaction between a user terminal and a server terminal in sending an encrypted public key, according to an embodiment of the present invention.

[0014] Figure 4 This is a schematic diagram illustrating a client-side encrypted file request according to an embodiment of the present invention;

[0015] Figure 5 This is a schematic diagram of a user-side file decryption provided in an embodiment of the present invention;

[0016] Figure 6 This is a flowchart illustrating an encrypted file transfer method applied to a server according to an embodiment of the present invention.

[0017] Figure 7 This is a schematic diagram illustrating the interaction between the server and the user in sending a digital certificate, according to an embodiment of the present invention.

[0018] Figure 8 This is a schematic diagram illustrating the principle of server-side file encryption according to an embodiment of the present invention;

[0019] Figure 9 A functional block diagram of an encrypted file transfer device applied to a user terminal, provided according to an embodiment of the present invention;

[0020] Figure 10 A functional block diagram of an encrypted file transfer device applied to a server side according to an embodiment of the present invention;

[0021] Figure 11 A schematic diagram of the structure of an electronic device for implementing an encrypted file transfer method according to an embodiment of the invention.

[0022] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0024] This application provides an encrypted file transfer method. The executing entity of the encrypted file transfer method includes, but is not limited to, at least one of the following: a server, a terminal, or an electronic device configured to execute the method provided in this application. In other words, the encrypted file transfer method can be executed by software or hardware installed on a terminal device or a server device; the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cluster of cloud servers. The server can be an independent server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0025] Reference Figure 1 The diagram shown is a signaling flow diagram of an encrypted file transmission method provided in an embodiment of the present invention.

[0026] In this embodiment, the user client sends a certificate verification request to the server. Upon receiving the certificate verification request, the server sends a digital certificate to the user client. The user client receives the digital certificate returned by the server based on the certificate verification request, and uses the digital certificate to authenticate the server, obtaining an authentication result. If the authentication result is secure, the user client generates a user key pair using an asymmetric encryption algorithm based on the digital certificate. The user client encrypts the user public key in the user key pair using the server public key in the digital certificate, obtaining an encrypted public key, and sends the encrypted public key to the server. The server receives the encrypted public key sent by the user client. The system decrypts the public key to obtain the user's public key; the user encrypts the generated file request using the user's private key from the user key pair to obtain an encrypted request, which is then sent to the server; the server receives the encrypted request from the user and retrieves the response file to be processed based on it; the server encrypts the response file to be processed using the user's public key to obtain the response file, which is then sent to the user; the user receives the response file returned by the server based on the public key and the encrypted request, decrypts the response file to obtain the original response file, and performs signature verification on the original response file to obtain the signature verification result.

[0027] Reference Figure 2 The diagram shown is a flowchart illustrating an encrypted file transfer method applied to a user terminal according to an embodiment of this application. In this embodiment, the encrypted file transfer method includes:

[0028] S21. Send a certificate verification request to the server.

[0029] In one embodiment, the certificate verification request is used to request a certificate from the server and then use the certificate to verify the server's identity. The certificate can be a CA (Certificate Authority) certificate, which is the technical foundation for digital signatures and is also used to prove the identity of online entities and the legitimacy of their public keys.

[0030] S22. Receive the digital certificate returned by the server based on the certificate verification request, verify the server based on the digital certificate, and obtain the authentication result.

[0031] In one embodiment, the purpose of authentication is to verify the identity information of the server, prevent the server's identity from being impersonated, and ensure the security of information interaction between the user and the server. A digital certificate is a credential used to prove the identity of the server, containing a public key, a private key, and ciphertext information. It is the carrier of the public key. Specifically, the public key in the digital certificate is bound to the entity identity of the server, which can indicate the matching relationship between the entity identity and the public key.

[0032] In one embodiment, authenticating the server based on a digital certificate to obtain an authentication result includes: performing a validity check on the digital certificate to obtain a validity judgment result; if the validity judgment result indicates that the digital certificate is valid, then the server's identity is determined to be secure, and this security is used as the authentication result; if the validity judgment result indicates that the digital certificate is invalid, then the server's identity is determined to be insecure, and this insecurity is used as the authentication result. In one embodiment, the validity check verifies the certificate validity period, certificate chain, and blacklist in the digital certificate; wherein, the certificate chain is a complete certificate trust chain composed of the root certificate, intermediate certificates, and user certificates. Only when all certificates in the certificate chain are valid is the digital certificate considered valid, and thus the user's authentication of the server is successful.

[0033] S23. When the identity verification result is secure, use an asymmetric encryption algorithm to generate a user key pair based on the digital certificate.

[0034] In one embodiment, a user key pair includes a public key and a private key, which can be generated using either RSA (asymmetric encryption) or elliptic curve cryptography. The user's private key (Private_user) is a random number, and the user's public key (Public_user) is generated from the private key using an asymmetric encryption algorithm (Public_user = RSA(Private_user)). Once the user's public key is made public, it is used as the user's identity credential. Because the private key cannot be derived from the public key, it is impossible to forge the private key corresponding to this public key, thus ensuring the security of the user key pair.

[0035] In one embodiment, generating a user key pair using an asymmetric encryption algorithm based on a digital certificate includes: initializing a random large prime number; calculating the random large prime number to obtain a product value; performing a multiplicative function calculation on the product value to obtain function parameters; and encapsulating the function parameters according to the ciphertext information in the digital certificate to obtain a key pair.

[0036] In one embodiment, the random large prime number can be two prime numbers P and Q, and then the product N of P and Q is calculated; the multiplicative function can be calculated using Euler's totient function on P and Q; the encapsulation can also use an asymmetric encryption method to encrypt the function parameters; the ciphertext information in the digital certificate is obtained by the server initiating the session key and then encapsulating and encrypting it using the public and private keys contained in the digital certificate; the user can use an asymmetric encryption algorithm to decapsulate the ciphertext information to obtain the same session key as the server, and encapsulate the function parameters according to the session key to obtain a key pair; the function parameters are represented as N, e, and d, where e and Φ(N) are coprime, N and e are encapsulated into the user's public key, and N and d are encapsulated into the user's private key.

[0037] In one embodiment, the product value is calculated using the following formula as a multiplicative function:

[0038] N = P * Q

[0039] Φ(N)=(P-1)(Q-1)

[0040] 1 < e < Φ(N)

[0041] e*d=1(modΦ(N))

[0042] Where P and Q represent random large prime numbers respectively; N represents the product value; d represents the intermediate calculation parameter in the function parameters; and e represents the random parameter in the function parameters.

[0043] S24. Use the server's public key in the digital certificate to encrypt the user's public key in the user key pair to obtain the encrypted public key, and send the encrypted public key to the server.

[0044] In one embodiment, encrypting the user's public key in the user key pair aims to protect its security. The encryption process involves encrypting the server's public key to obtain an encrypted public key, which is then sent to the server. The server decrypts the encrypted public key to obtain the user's public key. The specific process is as follows: Figure 3 As shown.

[0045] Specifically, in one embodiment, the server's public key is stored in a digital certificate, and the encryption process can use the RSA algorithm. The encryption process can be represented as: public_encrypt = RSA_encrypt(Public_server, Public_user); where Public_server represents the server's public key; Public_user represents the user's public key; and public_encrypt represents the encrypted public key.

[0046] S25. Encrypt the generated file request using the user's private key in the user key pair to obtain an encrypted request, and send the encrypted request to the server.

[0047] In one embodiment, a file request is the basis for the server to perform file queries within its system. Since the file request is encrypted using the user's private key in the user key pair, and the user's private key is only stored on the user's end and cannot be forged, it can prevent the user request from being tampered with by illegal intruders during transmission.

[0048] In one embodiment, encryption can employ an RSA algorithm such as... Figure 4As shown, the encryption process can be represented as: request_encrypt = RSA_encrypt(request, Private_user); where request_encrypt represents the encryption request; request represents the file request; and Private_user represents the user's private key.

[0049] S26. Receive the response file returned by the server based on the encryption public key and the encryption request, decrypt the response file, and obtain the original response file.

[0050] In one embodiment, the response file contains encrypted response content, an encrypted file, an encrypted random encryption key, and a file signature (response_encrypt, file_encrypt, secret_key_encrypt, digest).

[0051] In one embodiment, decrypting the response file to obtain the original response file includes: decrypting the key corresponding to the response file using the user's private key to obtain a symmetric encryption key; and decrypting the encrypted file in the response file using the symmetric encryption key to obtain the original response file.

[0052] In one embodiment, the original response file includes the response content, the original file, a symmetric encryption key, and a file signature, such as... Figure 5 As shown, this represents the file decrypted on the user's end.

[0053] S27. Verify the signature of the original response file to obtain the signature verification result.

[0054] In one embodiment, signature verification of the original response file to obtain a signature verification result includes: performing a hash signature calculation on the original file in the original response file to obtain a hash signature; and comparing the hash signature with the file signature in the original response file to obtain a signature verification result.

[0055] In one embodiment, the process of hash signature calculation can be represented as:

[0056] digest 1 = sha256(file)

[0057] Where digest 1 represents the hash signature; file represents the original file.

[0058] In one embodiment, consistency comparison is used to verify the integrity of the original response file; if the signature verification result is that the hash signature matches the file signature, it is determined that the original response file has not been tampered with; if the signature verification result is that the hash signature does not match the file signature, it is determined that the original response file has been tampered with.

[0059] Reference Figure 6 The diagram shown is a flowchart illustrating an encrypted file transfer method applied to a server according to an embodiment of this application. In this embodiment, the encrypted file transfer method includes:

[0060] S61. After receiving the certificate verification request sent by the user terminal, send a digital certificate to the user terminal; wherein, the digital certificate is used by the user terminal to perform identity verification and obtain the identity verification result;

[0061] In one embodiment, upon receiving a verification request, the locally stored CA (Certificate Authority) certificate is sent to the user's client, such as... Figure 7 As shown, this represents the process by which a user obtains the server's public key and verifies the server's identity. The user verifies the server's CA certificate, and the server contains a public key (Public_server) and a private key (Private_user). The local CA certificate typically contains the server's public key, issuing authority, and other information, which can prove the server's identity.

[0062] S62. Receive the encrypted public key sent by the user terminal, decrypt the encrypted public key to obtain the user public key; wherein, when the authentication result is secure, the encrypted public key is obtained by the user terminal encrypting the user public key in the user key pair generated according to the digital certificate using an asymmetric encryption algorithm.

[0063] In one embodiment, the user's public key is obtained by decrypting the encrypted public key using a preset server private key. The decryption process can be represented as follows:

[0064] Public_user=RSA_decrypt(public_encrypt, Private_server);

[0065] In this context, Public_user represents the user's public key; public_encrypt represents the encryption public key; and Private_server represents the server's private key.

[0066] In one embodiment, since the server's private key is stored in the server's local system and cannot be stolen by unauthorized intruders, unauthorized intruders cannot obtain the user's public key through decryption, thus ensuring the security of the user's public key during transmission. After obtaining the user's public key, the server saves it as the user's identity credential, and the server and user can establish communication based on the user's public key.

[0067] S63. Receive an encryption request sent by the user terminal, and obtain the response file to be processed according to the encryption request; wherein, the encryption request is obtained by the user terminal encrypting the generated file request using the user's private key in the user key pair.

[0068] In one embodiment, obtaining a response file to be processed based on an encryption request includes: decrypting the encryption request using a user's public key to obtain a file request; obtaining the file to be processed; performing symmetric encryption on the file to be processed to obtain an encrypted file pair; and searching for a file in the encrypted file pair based on the file request to obtain the response file to be processed.

[0069] In one embodiment, since asymmetric encryption algorithms take longer, symmetric encryption methods, such as the AES encryption algorithm, are used. Because the encryption key for each file to be processed is randomly generated, file security is improved. The encrypted file contains the encrypted file, a random encryption key, and a file signature (file_encrypt, secret_key, digest). The file signature is generated by using a hash algorithm (e.g., SHA256) to digest the file to be processed, and then the file digest is signed using the private key from the encryption key. The file signature is used by the user for signature verification to ensure that the file is not tampered with.

[0070] In one embodiment, encrypted file pairs are stored on the server side in a one-to-one correspondence between encrypted file pairs and plaintext files. The plaintext files serve as index information for the encrypted file pairs. First, the server-side system query service is used to search for the plaintext files based on the file request to obtain the plaintext files. Then, the encrypted file pairs corresponding to the plaintext files are obtained, which are the response files to be processed. File encryption can be performed when the server is idle, thus improving the efficiency of file encryption.

[0071] In one embodiment, since the process of decrypting an encryption request is similar to the process of decrypting an encryption public key, it will not be described in detail here.

[0072] S64. Encrypt the response file to be processed according to the user's public key to obtain the response file, and send the response file to the user terminal; wherein, the response file is used by the user terminal to decrypt to obtain the original response file, and the original response file is used by the user terminal to perform signature verification to obtain the signature verification result.

[0073] In one embodiment, the content of the response file to be processed is a pre-saved single response. Encrypting the response file to be processed using the user's public key involves encrypting both the single response content and a random encryption key within the response file. Specifically, for single response content that is not pre-saved by the system, a random encryption key can also be used for encryption to obtain encrypted response content. The encryption process can be represented as follows:

[0074] response_encrypt=AES_encrypt(response, secret_key);

[0075] Here, response_encrypt represents the encrypted response content; response represents the content of a single response; and secret_key represents the random encryption key.

[0076] like Figure 8 The diagram illustrates the principle of server-side file encryption. In one embodiment, the encrypted response content is appended to the response file, resulting in a response file sent to the user. This response file includes the encrypted response content (response_encrypt), the encrypted file (file_encrypt), the encrypted random encryption key (secret_key_encrypt), and a file signature (digest). This method of encrypting the response file eliminates the need to encrypt a pre-encrypted file; only the response content and the random encryption key need to be encrypted. Since the size of the response content and the random encryption key is relatively small, significant encryption time is saved. Furthermore, the randomness of the encryption key ensures its security during response file transmission.

[0077] This invention proposes an encrypted file transfer method. When a user initiates a request, the user's private key is used to encrypt the file request. The server verifies the user's identity using the user's public key, preventing impersonation and improving file transfer security. Encrypting the response file to be processed using the user's public key reduces the encryption process and speeds up file transfer. For multiple interactions between the user and server, different files use different encryption keys. This prevents the loss of all files in the event of key leakage, reducing the risk of file leakage and further enhancing transfer security. Therefore, the encrypted file transfer method proposed in this invention solves the problems of low efficiency and security in existing encrypted file transfer methods.

[0078] like Figure 9 The diagram shown is a functional block diagram of an encrypted file transfer device applied to a user terminal according to an embodiment of the present invention.

[0079] The encrypted file transfer device 900 of this invention can be installed in an electronic device. Depending on its functions, the encrypted file transfer device 900 may include an authentication module 901, an encryption public key generation module 902, a file request encryption module 903, a response file decryption module 904, and a signature verification module 905. A module in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and perform a fixed function, and which are stored in the memory of the electronic device.

[0080] In this embodiment, the functions of each module / unit are as follows: The authentication module 901 is used to send a certificate verification request to the server, receive the digital certificate returned by the server based on the certificate verification request, authenticate the server based on the digital certificate, and obtain the authentication result; the encryption public key generation module 902 is used to generate a user key pair based on the digital certificate using an asymmetric encryption algorithm when the authentication result is secure; encrypt the user public key using the server public key in the digital certificate to obtain the encryption public key, and send the encryption public key to the server; the file request encryption module 903 is used to encrypt the generated file request using the user private key in the user key pair to obtain the encryption request, and send the encryption request to the server; the response file decryption module 904 is used to receive the response file returned by the server based on the encryption public key and the encryption request, decrypt the response file, and obtain the original response file; the signature verification module 905 is used to perform signature verification on the original response file and obtain the signature verification result.

[0081] In detail, each module in the encrypted file transfer device 900 of this embodiment of the invention uses the same technical means as the encrypted file transfer method in the accompanying drawings and can produce the same technical effect, which will not be repeated here.

[0082] like Figure 10 The diagram shown is a functional block diagram of an encrypted file transfer device applied to a server side according to an embodiment of the present invention.

[0083] The encrypted file transfer device 1000 of the present invention can be installed in an electronic device. Depending on the functions implemented, the encrypted file transfer device 1000 may include a digital certificate sending module 1001, an encryption public key decryption module 1002, a pending response file acquisition module 1003, and a response file generation module 1004. The module of the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0084] In this embodiment, the functions of each module / unit are as follows: Digital certificate sending module 1001, used to send a digital certificate to the user terminal after receiving a certificate verification request from the user terminal; wherein, the digital certificate is used by the user terminal for identity verification to obtain an identity verification result; Encryption public key decryption module 1002, used to receive the encryption public key sent by the user terminal, decrypt the encryption public key to obtain the user public key; wherein, when the identity verification result is secure, the user terminal encrypts the user public key in the user key pair generated based on the digital certificate using an asymmetric encryption algorithm; Response file acquisition module 1003, used to receive an encryption request sent by the user terminal, and acquire the response file to be processed according to the encryption request; wherein, the encryption request is obtained by the user terminal encrypting the generated file request using the user private key in the user key pair; Response file generation module 1004, used to encrypt the response file to be processed according to the user public key to obtain a response file, and send the response file to the user terminal; wherein, the response file is used by the user terminal to decrypt to obtain the original response file, and the original response file is used by the user terminal for signature verification to obtain a signature verification result.

[0085] In detail, each module in the encrypted file transfer device 1000 of this embodiment of the invention uses the same technical means as the encrypted file transfer method in the accompanying drawings and can produce the same technical effect, which will not be repeated here.

[0086] like Figure 11 The diagram shown is a structural schematic of an electronic device that implements an encrypted file transfer method according to an embodiment of the present invention.

[0087] Electronic device 1100 may include processor 1101, memory 1102, communication bus 1103 and communication interface 1104, and may also include computer programs, such as encrypted file transfer programs, stored in memory 1102 and capable of running on processor 1101.

[0088] In some embodiments, the processor 1101 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 1101 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 1102 (e.g., executing encrypted file transfer programs) and calls data stored in the memory 1102 to perform various functions of the electronic device and process data.

[0089] The memory 1102 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 1102 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 1102 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 1102 can include both internal and external storage units of the electronic device. The memory 1102 can be used not only to store application software and various types of data installed on the electronic device, such as code based on encrypted file transfer programs, but also to temporarily store data that has been output or will be output.

[0090] The communication bus 1103 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 1102 and at least one processor 1101, etc.

[0091] The communication interface 1104 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), and optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.

[0092] Figure 11 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 11The structure shown does not constitute a limitation on the electronic device 1100, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0093] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to at least one processor 1101 via a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0094] It should be understood that the embodiments are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0095] Specifically, the specific implementation method of the processor 1101 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0096] Furthermore, if the modules / units integrated in the electronic device 1100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, a computer-readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0097] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program can implement the encrypted file transfer method of any of the above embodiments. It should be noted that the computer-readable storage medium can be volatile or non-volatile. For example, a computer-readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM). In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of modules is merely a logical functional division, and other division methods may be used in actual implementation.

[0098] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0099] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0100] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0101] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0102] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0103] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method of encrypted file transfer, characterized by, When applied to a user terminal, the method includes: Send a certificate verification request to the server; Receive the digital certificate returned by the server according to the certificate verification request, verify the server according to the digital certificate, and obtain the verification result; When the authentication result is secure, a user key pair is generated based on the digital certificate using an asymmetric encryption algorithm. The user public key in the user key pair is encrypted using the server public key in the digital certificate to obtain the encryption public key, and the encryption public key is sent to the server. The generated file request is encrypted using the user's private key in the user key pair to obtain an encrypted request, which is then sent to the server. Receive the response file returned by the server based on the encryption public key and the encryption request, decrypt the response file to obtain the original response file; The original response file is then subjected to signature verification to obtain the signature verification result; The step of generating a user key pair based on the digital certificate using an asymmetric encryption algorithm includes: Initialize a random large prime number, and calculate the product value using the random large prime number; Perform a multiplicative function calculation on the product value to obtain the function parameters; The product value is calculated using the following formula as a multiplicative function: wherein, respectively, as the random large prime number; as the product value; as an intermediate calculation parameter in the function parameter; as a random parameter in the function parameter; The function parameters are encapsulated based on the encrypted information in the digital certificate to obtain a key pair; The signature verification of the original response file to obtain the signature verification result includes: A hash signature is calculated on the original file in the original response file to obtain the hash signature; The hash signature is calculated using the following formula: in, This is represented as the hash signature; This refers to the original file; The hash signature is compared with the file signature in the original response file to obtain the signature verification result.

2. The encrypted file transfer method as described in claim 1, characterized in that, The process of decrypting the response file to obtain the original response file includes: The user's private key is used to decrypt the key corresponding to the response file to obtain a symmetric encryption key; The encrypted file in the response file is decrypted using the symmetric encryption key to obtain the original response file.

3. The encrypted file transfer method as described in claim 1, characterized in that, The step of authenticating the server based on the digital certificate to obtain the authentication result includes: The digital certificate is validated to obtain a validity determination result; If the legality judgment result indicates that the digital certificate is valid, then the identity security of the server is determined, and the identity security is used as the identity verification result. If the validity judgment result is that the digital certificate is invalid, then the identity of the server is determined to be insecure, and the insecure identity is used as the identity verification result.

4. A method for encrypting file transfer, characterized in that, Applied to the server side, the method includes: After receiving a certificate verification request from the user terminal, a digital certificate is sent to the user terminal; wherein, the digital certificate is used by the user terminal to perform identity verification and obtain an identity verification result; The system receives the encrypted public key sent by the user terminal, decrypts the encrypted public key to obtain the user public key; wherein, the encrypted public key is obtained by the user terminal encrypting the user public key in the user key pair generated based on the digital certificate using an asymmetric encryption algorithm when the identity verification result is secure. The system receives the encryption request sent by the user terminal and obtains the response file to be processed based on the encryption request; wherein the encryption request is obtained by the user terminal encrypting the generated file request using the user's private key in the user key pair; The response file to be processed is encrypted using the user's public key to obtain a response file, which is then sent to the user terminal. The response file is used by the user terminal to decrypt and obtain the original response file, which is then used by the user terminal for signature verification to obtain a signature verification result.

5. The encrypted file transfer method as described in claim 4, characterized in that, The step of obtaining the response file to be processed according to the encryption request includes: The encrypted request is decrypted using the user's public key to obtain the file request; Obtain the file to be processed, and perform symmetric encryption on the file to be processed to obtain an encrypted file pair; Based on the file request, a file search is performed in the encrypted file pair to obtain the response file to be processed.

6. An encrypted file transfer device, characterized in that, The device, applied to a user terminal, includes: The authentication module is used to send a certificate verification request to the server, receive the digital certificate returned by the server according to the certificate verification request, authenticate the server according to the digital certificate, and obtain the authentication result. The encryption public key generation module is used to generate a user key pair based on the digital certificate using an asymmetric encryption algorithm when the authentication result is secure, encrypt the user public key in the user key pair using the server public key in the digital certificate to obtain the encryption public key, and send the encryption public key to the server. The file request encryption module is used to encrypt the generated file request using the user's private key in the user key pair to obtain an encrypted request, and then send the encrypted request to the server. The response file decryption module is used to receive the response file returned by the server based on the encryption public key and the encryption request, decrypt the response file, and obtain the original response file. The signature verification module is used to verify the signature of the original response file and obtain the signature verification result. The encryption public key generation module is specifically used for: initializing a random large prime number, calculating the random large prime number, and obtaining the product value; Perform a multiplicative function calculation on the product value to obtain the function parameters; The product value is calculated using the following formula as a multiplicative function: in, These are respectively represented as the random large prime numbers; The product value is represented as the product value. This is represented as an intermediate calculation parameter in the function parameters; This is represented as a random parameter in the function parameters; The function parameters are encapsulated based on the encrypted information in the digital certificate to obtain a key pair; The signature verification module is specifically used to perform hash signature calculation on the original file in the original response file to obtain a hash signature; The hash signature is calculated using the following formula: in, This is represented as the hash signature; This refers to the original file; The hash signature is compared with the file signature in the original response file to obtain the signature verification result.

7. An encrypted file transfer device, characterized in that, The device, applied to the server side, includes: The digital certificate sending module is used to send a digital certificate to the user terminal after receiving a certificate verification request from the user terminal; wherein the digital certificate is used by the user terminal to perform identity verification and obtain an identity verification result. The encryption public key decryption module is used to receive the encryption public key sent by the user terminal, decrypt the encryption public key to obtain the user public key; wherein, the encryption public key is obtained by the user terminal encrypting the user public key in the user key pair generated according to the digital certificate using an asymmetric encryption algorithm when the identity verification result is secure. The pending response file acquisition module is used to receive the encryption request sent by the user terminal and acquire the pending response file according to the encryption request; wherein, the encryption request is obtained by the user terminal encrypting the generated file request using the user private key in the user key pair; The response file generation module is used to encrypt the response file to be processed according to the user's public key to obtain a response file, and send the response file to the user terminal; wherein, the response file is used by the user terminal to decrypt to obtain the original response file, and the original response file is used by the user terminal to perform signature verification to obtain a signature verification result.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The processor is used to execute a first computer program or a second computer program stored in the memory; When the processor executes the first computer program, it implements the steps of the method according to any one of claims 1 to 3; when the processor executes the second computer program, it implements the steps of the method according to claim 4 or 5.

9. A computer-readable storage medium having a first computer program or a second computer program stored thereon, characterized in that, When the first computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 3; when the second computer program is executed by the processor, it implements the steps of the method according to claim 4 or 5.

Citation Information

Patent Citations

  • Data transmission method and system based on hybrid encryption algorithm

    CN110535868A

  • Identity authentication method, device and system, electronic equipment and storage medium

    CN113836506A