WO2022083206A1 - 一种文件加密传输方法及装置 - Google Patents

一种文件加密传输方法及装置 Download PDF

Info

Publication number
WO2022083206A1
WO2022083206A1 PCT/CN2021/109219 CN2021109219W WO2022083206A1 WO 2022083206 A1 WO2022083206 A1 WO 2022083206A1 CN 2021109219 W CN2021109219 W CN 2021109219W WO 2022083206 A1 WO2022083206 A1 WO 2022083206A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
encrypted
string
information
files
Prior art date
Application number
PCT/CN2021/109219
Other languages
English (en)
French (fr)
Inventor
刘洋
秦正
杨腾达
何金彪
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US18/250,210 priority Critical patent/US20230396594A1/en
Publication of WO2022083206A1 publication Critical patent/WO2022083206A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/30Compression, e.g. Merkle-Damgard construction

Definitions

  • the present invention relates to the technical field of network data transmission, in particular to a file encryption transmission method and device.
  • File encryption technology improves the security of file network transmission.
  • domestic encryption algorithms and encryption machine technologies with independent intellectual property rights are becoming more and more important.
  • the encryption machine is used to directly encrypt the file, there will be certain requirements on the performance of the encryption machine, which will increase the hardware cost, and the method of only using the encryption machine to encrypt the key string to generate the cipher string will greatly improve the utilization of the encryption machine. efficiency and give full play to its encryption function.
  • One of the purposes of the present invention is to provide a file encryption transmission method, which uses a national secret algorithm to generate a random secret key string for each file, encrypts and decrypts the secret key string through an encryption machine, and uses big data technology to compress and encrypt the file.
  • Decryption and decompression operations greatly improve the controllability of autonomous encryption algorithms, the utilization of confidential machine resources, the security of file network transmission, and the efficiency of file transmission, making full use of hardware resources and saving time and cost.
  • the encrypted file, the password string and the information file are transmitted to the destination through the network; the destination performs the decryption step based on the password string and the encrypted file, obtains the decrypted file, and performs an integrity check on the decrypted file based on the file information.
  • the file information includes one or more combinations of file path, size, last modification time and file MD5 (Message-Digest Algorithm 5, Message-Digest Algorithm 5) value.
  • file MD5 Message-Digest Algorithm 5, Message-Digest Algorithm 5
  • the encrypted file is obtained by compressing and encrypting the file to be transmitted by using the secret key string; including:
  • the encrypted file, the password string and the file information are transmitted to the destination through the network, including:
  • the destination terminal performs the decryption step based on the password string and the encrypted file, obtains the decrypted file, and performs an integrity check on the decrypted file based on the file information, including:
  • the encryption machine is used at the destination to decrypt the encrypted string, including:
  • the integrity of the decrypted file is checked by the file information in the information file; including:
  • the present invention also provides a file encryption transmission device, comprising:
  • the file acquisition module is used to acquire the set of files to be transmitted
  • a secret key generation module for generating a secret key string using a first preset algorithm for the file information of each file in the set of files to be transmitted;
  • the compression and encryption module is used to compress and encrypt the set of files to be transmitted by using the key string to obtain encrypted files;
  • the secret key encryption module is used to encrypt the secret key string using a prefabricated encryption machine to generate a password string;
  • the file transfer module is used to transfer encrypted files, password strings and information files to the destination through the network
  • the file verification module is used for the destination end to perform the decryption step based on the cipher string and the encrypted file, obtain the decrypted file, and perform integrity verification on the decrypted file based on the file information.
  • the file information includes one or more combinations of file path, size, last modification time and file MD5 value.
  • the compression and encryption module performs the following operations:
  • the file transfer module performs the following operations:
  • the file verification module performs the following operations:
  • the encryption machine is used at the destination to decrypt the encrypted string, including:
  • the integrity of the decrypted file is checked by the file information in the information file; including:
  • FIG. 1 is a schematic diagram of a file encryption transmission method in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an application of an encryption machine in an embodiment of the present invention.
  • An embodiment of the present invention provides a file encryption transmission method, as shown in FIG. 1 , including:
  • S3 use the keychain to compress and encrypt the set of files to be transmitted to obtain encrypted files
  • the encrypted file, the password string and the information file are transmitted to the destination terminal through the network; the destination terminal performs the decryption step based on the password string and the encrypted file, obtains the decrypted file, and performs an integrity check on the decrypted file based on the file information.
  • the file encryption transmission method of the present invention is mainly the file transmission between the data source end and the destination end.
  • For each file use the SM4 national secret algorithm to randomly generate a 128-bit key string], use the encryption machine to encrypt the key string to generate an encrypted string, and transmit the file, file information and encrypted string to the destination through the network, and at the destination through The encryption machine decrypts the encrypted string to restore the secret key string, uses the big data technology to use the secret key string to decrypt and decompress the file, and performs file verification through the verification information.
  • the key string is used to compress and encrypt files, which will make full use of cluster hardware resources and greatly improve the efficiency of compression, encryption and transmission.
  • Compressing the encrypted file not only improves the security of network transmission, but also greatly reduces the file size after compression, which can improve the network transmission rate.
  • the integrity check of the file when the file is transmitted to the destination end for decryption and decompression, the integrity check of the file must be performed to ensure the function of the file transmission information.
  • the file information of each file in the file set to be transmitted use the first preset algorithm to generate a secret key string; for example: traverse the file information of all files in the file set [type, type ratio, file size, etc.
  • the file information includes one or more combinations of file path, size, last modification time and file MD5 value.
  • MD5 Message Digest Algorithm, a widely used cryptographic hash function that generates a 128-bit hash value to ensure complete and consistent information transmission.
  • a key string is used to compress and encrypt the file to be transmitted to obtain an encrypted file; including:
  • the set of files to be transmitted must be encrypted first.
  • the present invention adopts the method of compressing and then encrypting, and using the secret key string to compress and encrypt the files to be transmitted to obtain the encrypted files.
  • the specific steps are: compress the set of files to be transmitted. , output the compressed file tmpFile.zip; use Spark technology to encrypt the compressed file with the secret key string to generate the encrypted encrypted file encryptFile.zip; finally, in order to release the memory space used for compression and encryption, the temporary file tmpFile.zip needs to be deleted .
  • Different compression methods result in different compressed files, and a corresponding compression program is required to restore the original file. Therefore, the security of the file is further improved by using the key string after compression.
  • Spark a fast and general computing engine designed for large-scale data processing.
  • the encrypted file, the password string and the file information are transmitted to the destination through the network, including:
  • the decrypted file By making the file path, size, last modification time, MD5 check value, and encrypted string into an information file and transmitting it to the destination, the decrypted file can be verified after being decrypted by the destination.
  • the destination performs the decryption step based on the cipher string and the encrypted file, obtains the decrypted file, and performs an integrity check on the decrypted file based on the file information, including:
  • the encryption machine is used at the destination to decrypt the encrypted string, including:
  • the integrity of the decrypted file is checked by the file information in the information file; including:
  • the destination obtains the set of files to be transmitted by the data source through the reverse operation of encryption. After obtaining, it needs to verify the information file produced by the data source to ensure the security of data transmission.
  • SM4 the packet data algorithm of the wireless local area network standard. Symmetric encryption, the key length and block length are both 128 bits.
  • the present invention also provides a file encryption transmission device, comprising:
  • the file acquisition module is used to acquire the set of files to be transmitted
  • a secret key generation module for generating a secret key string using a first preset algorithm for the file information of each file in the set of files to be transmitted;
  • the compression and encryption module is used to compress and encrypt the set of files to be transmitted by using the key string to obtain encrypted files;
  • the secret key encryption module is used to encrypt the secret key string using a prefabricated encryption machine to generate a password string;
  • the file transfer module is used to transfer encrypted files, password strings and information files to the destination through the network
  • the file verification module is used for the destination end to perform the decryption step based on the cipher string and the encrypted file, obtain the decrypted file, and perform integrity verification on the decrypted file based on the file information.
  • the file encryption transmission device of the present invention is mainly a file transmission between a data source end and a destination end.
  • the main steps are: acquiring a set of files to be transmitted, generating a secret key string, using the big data technology to compress the encrypted file with the secret key string, and using The encryption machine encrypts the key string to generate the encrypted string, transmits the file, file information and encrypted string to the destination through the network, and decrypts the encrypted string through the encryption machine at the destination to restore the secret key string, and uses the big data technology to decrypt and decompress the secret key string.
  • the file is verified by the verification information.
  • the key string is used to compress and encrypt files, which will make full use of cluster hardware resources and greatly improve the efficiency of compression, encryption and transmission.
  • Compressing the encrypted file not only improves the security of network transmission, but also greatly reduces the file size after compression, which can improve the network transmission rate.
  • the integrity check of the file when the file is transmitted to the destination end for decryption and decompression, the integrity check of the file must be performed to ensure the function of the file transmission information.
  • the file information of each file in the file set to be transmitted use the first preset algorithm to generate a secret key string; for example: traverse the file information of all files in the file set [type, type ratio, file size, etc.
  • FIG. 2 is a schematic diagram of the application of the encryption machine in the present invention.
  • the file information includes one or more combinations of file path, size, last modification time and file MD5 value.
  • the compression encryption module performs the following operations:
  • the compressed file is encrypted with the key string, and the encrypted encrypted file encryptFile.zip is generated;
  • the set of files to be transmitted must be encrypted first.
  • the present invention adopts the method of compressing and then encrypting, and using the secret key string to compress and encrypt the files to be transmitted to obtain the encrypted files.
  • the specific steps are: compress the set of files to be transmitted. , output the compressed file tmpFile.zip; use Spark technology to encrypt the compressed file with the secret key string to generate the encrypted encrypted file encryptFile.zip; finally, in order to release the memory space used for compression and encryption, the temporary file tmpFile.zip needs to be deleted .
  • Different compression methods result in different compressed files.
  • Corresponding compression programs are required to restore the original files. Therefore, the security of the files is further improved by using the secret key string after compression.
  • the file transfer module performs the following operations:
  • the file verification module performs the following operations:
  • the integrity of the decrypted file is verified by the file information in the information file; wherein, the encrypted string is decrypted by an encryption machine at the destination end, including:
  • the integrity of the decrypted file is checked by the file information in the information file; including:
  • the destination obtains the set of files to be transmitted by the data source through the reverse operation of encryption. After obtaining, it needs to verify the information file produced by the data source to ensure the security of data transmission.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)

Abstract

一种文件加密传输方法及装置,其中,方法包括:获取待传输文件集合;针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;使用秘钥串对待传输文件集合进行压缩加密获得加密文件;使用预制的加密机对秘钥串进行加密生成密码串;通过网络将加密文件和密码串以及信息文件传输至目的端;目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验。本发明的文件加密传输方法,大大提高了自主加密算法的可控性、机密机资源的利用率、文件网络传输的安全性,以及文件传输的效率,充分利用了硬件资源,节约了时间成本。

Description

一种文件加密传输方法及装置
本申请要求于2020年10月23日提交中国专利局、申请号为202011148386.2、发明名称为“一种文件加密传输方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及网络数据传输技术领域,特别涉及一种文件加密传输方法及装置。
背景技术
目前,网络环境越来越复杂,窃取泄密事件屡有发生,文件网络传输的安全性越来越重要。文件加密技术提高了文件网络传输的安全性,随着国际形势的变化,拥有自主知识产权的国产加密算法和加密机技术越发显得重要。但是如果使用加密机直接对文件进行加密,就会对加密机的性能有一定的要求,这样会增加硬件成本,而仅仅使用加密机加密秘钥串生成密码串的方法会大大提高加密机的利用效率,充分发挥其加密功能。
发明内容
本发明目的之一在于提供了一种文件加密传输方法,使用国密算法为每个文件生成随机秘钥串,通过加密机对秘钥串进行加解密,利用大数据技术对文件进行压缩加密及解密解压操作,这样大大提高了自主加密算法的可控性、机密机资源的利用率、文件网络传输的安全性,以及文件传输的效率,充分利用了硬件资源,节约了时间成本。
本发明实施例提供的一种文件加密传输方法,包括:
获取待传输文件集合;
针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
使用秘钥串对待传输文件集合进行压缩加密获得加密文件;
使用预制的加密机对秘钥串进行加密生成密码串;
通过网络将加密文件和密码串以及信息文件传输至目的端;目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验。
优选的,文件信息包括:文件路径、大小、最后修改时间和文件MD5(Message-Digest Algorithm 5,信息-摘要算法5)值中一种或多种结合。
优选的,使用秘钥串对待传输文件进行压缩加密获得加密文件;包括:
将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;
利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;
删除临时文件tmpFile.zip。
优选的,通过网络将加密文件和密码串以及文件信息传输至目的端,包括:
将文件路径、大小、最后修改时间、MD5校验值、加密串以JSON(JavaScript Object Notation,Java脚本对象注释)格式写入对应加密文件的信息文件fileName.xml中;
先将加密后的加密文件传输到目的端;
再将信息文件fileName.xml文件传输到目的端。
优选的,目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验,包括:
在目的端使用加密机解密加密串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;
通过信息文件中的文件信息对解密文件进行完整性校验;
其中,在目的端使用加密机解密加密串,包括:
读取信息文件fileName.xml,获取加密串;
使用加密机解密加密串,还原出秘钥串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;包括:
使用SM4国密算法解密压缩文件,得到解密后的临时文件tmpFile.zip;
利用Spark技术将临时文件tmpFlile.zip解压,还原出解密文件targetSourceFile;
删除临时文件tmpFlile.zip;
通过信息文件中的文件信息对解密文件进行完整性校验;包括:
读取信息文件fileName.xml获取文件大小、最后修改时间、MD5校验值信息;
获取目的端的解密文件targetSourceFile的文件大小、MD5校验值;
对信息文件与解密文件中的比文件大小及MD5校验值进行完整性校验。
本发明还提供一种文件加密传输装置,包括:
文件获取模块,用于获取待传输文件集合;
秘钥生成模块,用于针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
压缩加密模块,用于使用秘钥串对待传输文件集合进行压缩加密获得加密文件;
秘钥加密模块,用于使用预制的加密机对秘钥串进行加密生成密码串;
文件传输模块,用于通过网络将加密文件和密码串以及信息文件传输至目的端;
文件校验模块,用于目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验。
优选的,文件信息包括:文件路径、大小、最后修改时间和文件MD5值中一种或多种结合。
优选的,压缩加密模块执行如下操作:
将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;
利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;
删除临时文件tmpFile.zip。
优选的,文件传输模块执行如下操作:
将文件路径、大小、最后修改时间、MD5校验值、加密串以JSON格式写入对应加密文件的信息文件fileName.xml中;
先将加密后的加密文件传输到目的端;
再将信息文件fileName.xml文件传输到目的端。
优选的,文件校验模块执行如下操作:
在目的端使用加密机解密加密串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;
通过信息文件中的文件信息对解密文件进行完整性校验;
其中,在目的端使用加密机解密加密串,包括:
读取信息文件fileName.xml,获取加密串;
使用加密机解密加密串,还原出秘钥串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;包括:
使用SM4国密算法解密压缩文件,得到解密后的临时文件tmpFile.zip;
利用Spark技术将临时文件tmpFlile.zip解压,还原出解密文件targetSourceFile;
删除临时文件tmpFlile.zip;
通过信息文件中的文件信息对解密文件进行完整性校验;包括:
读取信息文件fileName.xml获取文件大小、最后修改时间、MD5校验值信息;
获取目的端的解密文件targetSourceFile的文件大小、MD5校验值;
对信息文件与解密文件中的比文件大小及MD5校验值进行完整性校验。
本发明提出一种文件加密方法具有如下有益效果:
一、使用国密算法为每个文件生成随机秘钥串,通过加密机对秘钥串进行加解密,利用大数据技术对文件进行压缩解密及解密解压操作,大大提高了自主加密算法的可控性、机密机资源的利用率、文件网络传输的安全性,以及文件传输的效率,充分利用了硬件资源,节约了时间成本。
二、即便加密后的文件在网络传输过程中被黑客劫持获取,也会因缺少密码串信息而无法破解文件。即使黑客能获取加密后的文件和密码串,但由于文件是使用秘钥串加密的,所以黑客需要将密码串通过加密机还原出秘钥串,但加密机作为物理资源很难被窃取,所以这种基于机密机的文件压缩加密方法具有很强的安全性。
三、能普遍适用于通过网络传输文件的情况,尤其适用于大文件及已经部署大数据集群的环境,能够单独应用于文件网络传输的场景,也能适用于系统中的对文件传输的安全性有较高要求的场景,保障了文件信息的安全性。
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。
附图说明
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:
图1为本发明实施例中一种文件加密传输方法的示意图;
图2为加密机在本发明实施例中应用的示意图。
具体实施方式
以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
本发明实施例提供了一种文件加密传输方法,如图1所示,包括:
S1:获取待传输文件集合;
S2:针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
S3:使用秘钥串对待传输文件集合进行压缩加密获得加密文件;
S4:使用预制的加密机对秘钥串进行加密生成密码串;
S5:通过网络将加密文件和密码串以及信息文件传输至目的端;目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对 解密文件进行完整性校验。
上述技术方案的工作原理及有益效果为:
本发明的文件加密传输方法,主要是数据源端与目的端之间的文件传输,主要步骤为:获取待传输文件集合、生成秘钥串、利用大数据技术使用秘钥串压缩加密文件【针对每一个文件,使用SM4国密算法随机生成一个128位的秘钥串】,使用加密机加密秘钥串生成加密串,将文件、文件信息及加密串通过网络传输到目的端,在目的端通过加密机解密加密串还原出秘钥串,利用大数据技术使用秘钥串解密解压文件,通过校验信息进行文件校验。利用大数据技术,使用秘钥串对文件进行压缩加密操作,这样会充分利用集群硬件资源,大大提高压缩加密效率和传输效率。压缩加密后的文件不仅提高了网络传输的安全性,而且压缩后大大缩减了文件体积,能够提高网络传输速率。为了保证文件的完整性,当文件传输到目的端解密解压后,必须对文件进行完整性校验,以确保文件传递信息的作用。更进一步地,针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;例如:遍历文件集合内所有文件的文件信息【类型、类型占比、文件大小等】,查询预制的对照表确定出第一秘钥串;这样在目的端直接根据第一秘钥串即可反推出文件集合内的文件信息,无需再制作信息文件发送,进一步提高文件传输的安全性。
在一个实施例中,文件信息包括:文件路径、大小、最后修改时间和文件MD5值中一种或多种结合。MD5:信息摘要算法,一种被广泛使用的密码散列函数,可以产生出一个128位的散列值,用于确保信息传输完整一致。
为了实现文件的压缩加密,在一个实施例中,使用秘钥串对待传输文件进行压缩加密获得加密文件;包括:
将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;
利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;
删除临时文件tmpFile.zip。
上述技术方案的工作原理及有益效果为:
在数据源端首先要对带传输文件集合进行加密处理,本发明采用的先压缩后加密,在使用秘钥串对待传输文件进行压缩加密获得加密文件的具体步骤为:将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;最后为了释放压缩和加密使用的内存空间,还需删除临时文件tmpFile.zip。压缩的方式不同,所产生的压缩文件也不同,需要对应的压缩程序才能还原成原文件,故先压缩后采用秘钥串更进一步提高了文件的安全性。其中,Spark:专为大规模数据处理而设计的快速通用的计算引擎。
在一个实施例中,通过网络将加密文件和密码串以及文件信息传输至目的端,包括:
将文件路径、大小、最后修改时间、MD5校验值、加密串以JSON格式写入对应加密文件的信息文件fileName.xml中;
先将加密后的加密文件传输到目的端;
再将信息文件fileName.xml文件传输到目的端。
上述技术方案的工作原理及有益效果为:
通过将文件路径、大小、最后修改时间、MD5校验值、加密串制作信息文件并传输至目的端,实现目的端解密后对解密文件的验证。
在一个实施例中,目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验,包括:
在目的端使用加密机解密加密串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;
通过信息文件中的文件信息对解密文件进行完整性校验;
其中,在目的端使用加密机解密加密串,包括:
读取信息文件fileName.xml,获取加密串;
使用加密机解密加密串,还原出秘钥串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;包括:
使用SM4国密算法解密压缩文件,得到解密后的临时文件tmpFile.zip;
利用Spark技术将临时文件tmpFlile.zip解压,还原出解密文件 targetSourceFile;
删除临时文件tmpFlile.zip;
通过信息文件中的文件信息对解密文件进行完整性校验;包括:
读取信息文件fileName.xml获取文件大小、最后修改时间、MD5校验值信息;
获取目的端的解密文件targetSourceFile的文件大小、MD5校验值;
对信息文件与解密文件中的比文件大小及MD5校验值进行完整性校验。
上述技术方案的工作原理及有益效果为:
目的端通过加密的逆操作,获取数据源端所要传输的文件集合,当获取后需要根据数据源制作的信息文件进行验证,保证数据传输的安全性。其中,SM4:无线局域网标准的分组数据算法。对称加密,密钥长度和分组长度均为128位。
本发明还提供一种文件加密传输装置,包括:
文件获取模块,用于获取待传输文件集合;
秘钥生成模块,用于针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
压缩加密模块,用于使用秘钥串对待传输文件集合进行压缩加密获得加密文件;
秘钥加密模块,用于使用预制的加密机对秘钥串进行加密生成密码串;
文件传输模块,用于通过网络将加密文件和密码串以及信息文件传输至目的端;
文件校验模块,用于目的端基于密码串和加密文件实行解密步骤,获取解密文件,基于文件信息对解密文件进行完整性校验。
上述技术方案的工作原理及有益效果为:
本发明的文件加密传输装置,主要是数据源端与目的端之间的文件传输,主要步骤为:获取待传输文件集合、生成秘钥串、利用大数据技术使用秘钥串压缩加密文件,使用加密机加密秘钥串生成加密串,将文件、文件信息及加密串通过网络传输到目的端,在目的端通过加密机解密加密串 还原出秘钥串,利用大数据技术使用秘钥串解密解压文件,通过校验信息进行文件校验。利用大数据技术,使用秘钥串对文件进行压缩加密操作,这样会充分利用集群硬件资源,大大提高压缩加密效率和传输效率。压缩加密后的文件不仅提高了网络传输的安全性,而且压缩后大大缩减了文件体积,能够提高网络传输速率。为了保证文件的完整性,当文件传输到目的端解密解压后,必须对文件进行完整性校验,以确保文件传递信息的作用。更进一步地,针对待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;例如:遍历文件集合内所有文件的文件信息【类型、类型占比、文件大小等】,查询预制的对照表确定出第一秘钥串;这样在目的端直接根据第一秘钥串即可反推出文件集合内的文件信息,无需再制作信息文件发送,进一步提高文件传输的安全性。其中,图2为加密机在本发明中应用的示意图。
在一个实施例中,文件信息包括:文件路径、大小、最后修改时间和文件MD5值中一种或多种结合。
在一个实施例中,压缩加密模块执行如下操作:
将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;
利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;
删除临时文件tmpFile.zip。
上述技术方案的工作原理及有益效果为:
在数据源端首先要对带传输文件集合进行加密处理,本发明采用的先压缩后加密,在使用秘钥串对待传输文件进行压缩加密获得加密文件的具体步骤为:将待传输文件集合进行压缩,输出压缩文件tmpFile.zip;利用Spark技术,使用秘钥串对压缩文件加密,生成加密后的加密文件encryptFile.zip;最后为了释放压缩和加密使用的内存空间,还需删除临时文件tmpFile.zip。压缩的方式不同,所产生的压缩文件也不同,需要对应的压缩程序才能还原成原文件,故先压缩后采用秘钥串更进一步提高了文件的安全性。
在一个实施例中,文件传输模块执行如下操作:
将文件路径、大小、最后修改时间、MD5校验值、加密串以JSON格式写入对应加密文件的信息文件fileName.xml中;
先将加密后的加密文件传输到目的端;
再将信息文件fileName.xml文件传输到目的端。
上述技术方案的工作原理及有益效果为:
通过将文件路径、大小、最后修改时间、MD5校验值、加密串制作信息文件并传输至目的端,实现目的端解密后对解密文件的验证。
在一个实施例中,文件校验模块执行如下操作:
在目的端使用加密机解密加密串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;
通过信息文件中的文件信息对解密文件进行完整性校验;其中,在目的端使用加密机解密加密串,包括:
读取信息文件fileName.xml,获取加密串;
使用加密机解密加密串,还原出秘钥串;
利用Spark技术,使用秘钥串解密解压对应的加密文件;包括:
使用SM4国密算法解密压缩文件,得到解密后的临时文件tmpFile.zip;
利用Spark技术将临时文件tmpFlile.zip解压,还原出解密文件targetSourceFile;
删除临时文件tmpFlile.zip;
通过信息文件中的文件信息对解密文件进行完整性校验;包括:
读取信息文件fileName.xml获取文件大小、最后修改时间、MD5校验值信息;
获取目的端的解密文件targetSourceFile的文件大小、MD5校验值;
对信息文件与解密文件中的比文件大小及MD5校验值进行完整性校验。
上述技术方案的工作原理及有益效果为:
目的端通过加密的逆操作,获取数据源端所要传输的文件集合,当获取后需要根据数据源制作的信息文件进行验证,保证数据传输的安全性。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离 本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (10)

  1. 一种文件加密传输方法,其特征在于,包括:
    获取待传输文件集合;
    针对所述待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
    使用所述秘钥串对所述待传输文件集合进行压缩加密获得加密文件;
    使用预制的加密机对所述秘钥串进行加密生成密码串;
    通过网络将所述加密文件和所述密码串以及信息文件传输至目的端;所述目的端基于所述密码串和所述加密文件实行解密步骤,获取解密文件,基于所述文件信息对所述解密文件进行完整性校验。
  2. 如权利要求1所述的文件加密传输方法,其特征在于,所述文件信息包括:文件路径、大小、最后修改时间和文件MD5值中一种或多种结合。
  3. 如权利要求1所述的文件加密传输方法,其特征在于,所述使用所述秘钥串对所述待传输文件进行压缩加密获得加密文件;包括:
    将所述待传输文件集合进行压缩,输出压缩文件tmpFile.zip;
    利用Spark技术,使用所述秘钥串对所述压缩文件加密,生成加密后的所述加密文件encryptFile.zip;
    删除临时文件tmpFile.zip。
  4. 如权利要求1所述的文件加密传输方法,其特征在于,所述通过网络将所述加密文件和所述密码串以及所述文件信息传输至目的端,包括:
    将文件路径、大小、最后修改时间、MD5校验值、加密串以JSON格式写入对应所述加密文件的信息文件fileName.xml中;
    先将加密后的所述加密文件传输到所述目的端;
    再将所述信息文件fileName.xml文件传输到所述目的端。
  5. 如权利要求1所述的文件加密传输方法,其特征在于,所述目的端基于所述密码串和所述加密文件实行解密步骤,获取解密文件,基于所述文件信息对所述解密文件进行完整性校验,包括:
    在所述目的端使用所述加密机解密所述加密串;
    利用Spark技术,使用所述秘钥串解密解压对应的所述加密文件;
    通过信息文件中的文件信息对所述解密文件进行完整性校验。
  6. 如权利要求5所述的文件加密传输方法,其特征在于,所述在所述目的端使用所述加密机解密所述加密串,包括:
    读取信息文件fileName.xml,获取所述加密串;
    使用所述加密机解密所述加密串,还原出所述秘钥串。
  7. 如权利要求5所述的文件加密传输方法,其特征在于,所述利用Spark技术,使用所述秘钥串解密解压对应的所述加密文件;包括:
    使用SM4国密算法解密所述压缩文件,得到解密后的临时文件tmpFile.zip;
    利用Spark技术将临时文件tmpFlile.zip解压,还原出解密文件targetSourceFile;
    删除临时文件tmpFlile.zip。
  8. 如权利要求5所述的文件加密传输方法,其特征在于,所述通过信息文件中的文件信息对所述解密文件进行完整性校验;包括:
    读取所述信息文件fileName.xml获取文件大小、最后修改时间、MD5校验值信息;
    获取所述目的端的解密文件targetSourceFile的文件大小、MD5校验值;
    对所述信息文件与所述解密文件中的比文件大小及MD5校验值进行完整性校验。
  9. 一种文件加密传输装置,其特征在于,包括:
    文件获取模块,用于获取待传输文件集合;
    秘钥生成模块,用于针对所述待传输文件集合内的每个文件的文件信息,使用第一预设算法生成秘钥串;
    压缩加密模块,用于使用所述秘钥串对所述待传输文件集合进行压缩加密获得加密文件;
    秘钥加密模块,用于使用预制的加密机对所述秘钥串进行加密生成密码串;
    文件传输模块,用于通过网络将所述加密文件和所述密码串以及信息文件传输至目的端;
    文件校验模块,用于所述目的端基于所述密码串和所述加密文件实行解密步骤,获取解密文件,基于所述文件信息对所述解密文件进行完整性校验。
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有文件加密传输程序,其中所述文件加密传输程序被处理器执行时,实现如权利要求1至8中任一项所述的文件加密传输方法的步骤。
PCT/CN2021/109219 2020-10-23 2021-07-29 一种文件加密传输方法及装置 WO2022083206A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/250,210 US20230396594A1 (en) 2020-10-23 2021-07-29 File Encryption and Transmission Method and Apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011148386.2A CN112311865B (zh) 2020-10-23 2020-10-23 一种文件加密传输方法及装置
CN202011148386.2 2020-10-23

Publications (1)

Publication Number Publication Date
WO2022083206A1 true WO2022083206A1 (zh) 2022-04-28

Family

ID=74327526

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109219 WO2022083206A1 (zh) 2020-10-23 2021-07-29 一种文件加密传输方法及装置

Country Status (3)

Country Link
US (1) US20230396594A1 (zh)
CN (1) CN112311865B (zh)
WO (1) WO2022083206A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134138A (zh) * 2022-06-27 2022-09-30 山东首瀚信息科技有限公司 一种基于单向光闸的文件同步方法
CN115296911A (zh) * 2022-08-06 2022-11-04 山东润通科技有限公司 基于国密算法的数据加密采集传输仪及安全认证方法
CN115982109A (zh) * 2023-03-20 2023-04-18 北京飞轮数据科技有限公司 数据同步方法、装置、电子设备和计算机可读介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311865B (zh) * 2020-10-23 2023-02-28 苏州浪潮智能科技有限公司 一种文件加密传输方法及装置
CN112929444B (zh) * 2021-02-19 2022-09-23 广东云智安信科技有限公司 基于压缩文件的数据安全防护方法、系统、设备及介质
CN113014580A (zh) * 2021-02-24 2021-06-22 天津中新智冠信息技术有限公司 文件传输方法、装置、电子设备及存储介质
CN113065148A (zh) * 2021-04-20 2021-07-02 大连宏燊软件技术有限公司 一种rpa流程封装打包的方法和打包系统
CN113225180A (zh) * 2021-04-29 2021-08-06 北京连山科技股份有限公司 一种通信密钥的保护方法和系统
CN114614982A (zh) * 2022-02-24 2022-06-10 广东电网有限责任公司 智能量测密码应用系统及其应用方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104732159A (zh) * 2013-12-24 2015-06-24 北京慧眼智行科技有限公司 一种文件处理方法及装置
US20190073486A1 (en) * 2003-07-16 2019-03-07 James C. Peterson Method for strongly encrypting .zip files
CN109547215A (zh) * 2018-12-28 2019-03-29 鞍钢集团自动化有限公司 一种基于移动终端指纹的文档信息保护方法
CN110099064A (zh) * 2019-05-08 2019-08-06 广州创想云科技有限公司 一种基于物联网的文件处理方法、装置、设备和存储介质
CN111709038A (zh) * 2020-05-07 2020-09-25 北京中科凡语科技有限公司 文件加密解密方法、分布式存储系统、设备及存储介质
CN112311865A (zh) * 2020-10-23 2021-02-02 苏州浪潮智能科技有限公司 一种文件加密传输方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254336A (zh) * 2016-07-29 2016-12-21 北京北信源软件股份有限公司 一种基于文件映射加密的文件传输方法
CN110191136A (zh) * 2019-06-12 2019-08-30 南京东科优信网络安全技术研究院有限公司 一种便捷的文件安全传输方法及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190073486A1 (en) * 2003-07-16 2019-03-07 James C. Peterson Method for strongly encrypting .zip files
CN104732159A (zh) * 2013-12-24 2015-06-24 北京慧眼智行科技有限公司 一种文件处理方法及装置
CN109547215A (zh) * 2018-12-28 2019-03-29 鞍钢集团自动化有限公司 一种基于移动终端指纹的文档信息保护方法
CN110099064A (zh) * 2019-05-08 2019-08-06 广州创想云科技有限公司 一种基于物联网的文件处理方法、装置、设备和存储介质
CN111709038A (zh) * 2020-05-07 2020-09-25 北京中科凡语科技有限公司 文件加密解密方法、分布式存储系统、设备及存储介质
CN112311865A (zh) * 2020-10-23 2021-02-02 苏州浪潮智能科技有限公司 一种文件加密传输方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134138A (zh) * 2022-06-27 2022-09-30 山东首瀚信息科技有限公司 一种基于单向光闸的文件同步方法
CN115134138B (zh) * 2022-06-27 2024-06-11 山东首瀚信息科技有限公司 一种基于单向光闸的文件同步方法
CN115296911A (zh) * 2022-08-06 2022-11-04 山东润通科技有限公司 基于国密算法的数据加密采集传输仪及安全认证方法
CN115982109A (zh) * 2023-03-20 2023-04-18 北京飞轮数据科技有限公司 数据同步方法、装置、电子设备和计算机可读介质

Also Published As

Publication number Publication date
US20230396594A1 (en) 2023-12-07
CN112311865A (zh) 2021-02-02
CN112311865B (zh) 2023-02-28

Similar Documents

Publication Publication Date Title
WO2022083206A1 (zh) 一种文件加密传输方法及装置
CN103763315B (zh) 一种应用于移动设备云存储的可信数据存取控制方法
CN102025503B (zh) 一种集群环境下数据安全实现方法和一种高安全性的集群
CN113225352B (zh) 一种数据传输方法、装置、电子设备及存储介质
CN106506453B (zh) 基于快速匹配和完整性检测的电力大数据传输方法及系统
US20180063105A1 (en) Management of enciphered data sharing
CN116321129B (zh) 一种轻量级的基于动态密钥的电力交易专网通信加密方法
WO2023005734A1 (zh) 车辆数据上传方法、装置、车辆、系统及存储介质
CN113609522B (zh) 数据授权及数据访问方法和装置
CN112165443A (zh) 一种多密钥信息加密解密方法、装置及存储介质
CN113312608B (zh) 一种基于时间戳的电力计量终端身份认证方法及系统
CN115632880B (zh) 一种基于国密算法的可靠数据传输及存储的方法及系统
CN106453391A (zh) 一种重复长数据加密传输的方法及系统
JP2002508892A (ja) 双方向認証および暗号化システム
CN113347143A (zh) 一种身份验证方法、装置、设备及存储介质
CN114499857B (zh) 一种实现大数据量子加解密中数据正确性与一致性的方法
US7886160B2 (en) Information processing apparatus and method, and computer program
CN112532384B (zh) 基于分组密钥模式下对传输密钥快速加解密的方法
CN109995785A (zh) 基于量子密码的局域网内文件安全解锁方法
TW202231014A (zh) 訊息傳輸系統以及應用其中之使用者裝置與資訊安全硬體模組
Li et al. Itls/idtls: Lightweight end-to-end security protocol for iot through minimal latency
US20220345298A1 (en) Systems and methods for providing signatureless, confidential and authentication of data during handshake for classical and quantum computing environments
WO2018054144A1 (zh) 对称密钥动态生成方法、装置、设备及系统
CN116132025A (zh) 一种基于预置密钥组的密钥协商方法、装置和通信系统
CN211046952U (zh) 一种基于NB-IoT的物联网安全通信装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21881626

Country of ref document: EP

Kind code of ref document: A1