CN116781420B - Electronic file secure transmission encryption method and system - Google Patents

Electronic file secure transmission encryption method and system Download PDF

Info

Publication number
CN116781420B
CN116781420B CN202311034047.5A CN202311034047A CN116781420B CN 116781420 B CN116781420 B CN 116781420B CN 202311034047 A CN202311034047 A CN 202311034047A CN 116781420 B CN116781420 B CN 116781420B
Authority
CN
China
Prior art keywords
electronic file
ciphertext
compression result
result
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311034047.5A
Other languages
Chinese (zh)
Other versions
CN116781420A (en
Inventor
谢文迅
陆猛
范红达
朱静宇
张伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dianju Information Technology Co ltd
Original Assignee
Beijing Dianju Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dianju Information Technology Co ltd filed Critical Beijing Dianju Information Technology Co ltd
Priority to CN202311034047.5A priority Critical patent/CN116781420B/en
Publication of CN116781420A publication Critical patent/CN116781420A/en
Application granted granted Critical
Publication of CN116781420B publication Critical patent/CN116781420B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0057Block codes
    • 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]
    • 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/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • 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/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention relates to the technical field of data encryption transmission, in particular to a method and a system for securely transmitting and encrypting an electronic file, comprising the following steps: obtaining the frequencies of all characters in the electronic file, constructing a Huffman coding table according to the frequencies of all characters, and carrying out coding compression on the electronic file according to the Huffman coding table to obtain a coding compression result of the electronic file; setting a key according to the chaotic map, and obtaining a conversion position sequence according to the key; encrypting the encoding compression result of the electronic file according to the conversion position sequence to obtain a ciphertext of the encoding compression result of the electronic file; and carrying out safe transmission on the ciphertext of the electronic file. The invention ensures confidentiality and integrity of information in the electronic file, prevents unauthorized visitors from acquiring and tampering file contents, and ensures transmission efficiency of the electronic file.

Description

Electronic file secure transmission encryption method and system
Technical Field
The invention relates to the technical field of data encryption transmission, in particular to a method and a system for securely transmitting and encrypting an electronic file.
Background
For electronic files containing personal identity information, business secrets or other sensitive data, in order to ensure confidentiality and integrity of information in the electronic file, to prevent unauthorized visitors from obtaining and tampering with the file content, the electronic file needs to be encrypted; meanwhile, in order to ensure the transmission efficiency of the electronic file, the electronic file needs to be encoded and compressed first.
If the electronic file is subjected to encryption and then coding compression, the conventional coding compression method realizes compression based on the redundancy characteristics, the association characteristics and other statistical characteristics of the data, and the encryption operation covers the original statistical characteristics of the data, so that the encrypted data is difficult to be subjected to coding compression by using the conventional coding compression method; if the electronic file is encoded and compressed before being encrypted, the data in the electronic file can be converted into a binary form consisting of 0 and 1 after being encoded and compressed, and the conventional encryption method is not suitable for encrypting the data in the binary form.
Therefore, there is a need for an encryption method suitable for encrypting data in binary form after encoding compression, which ensures the confidentiality and integrity of information in an electronic file, prevents unauthorized visitors from acquiring and tampering with the file content, and ensures the transmission efficiency of the electronic file.
Disclosure of Invention
The invention provides a secure transmission encryption method and system for electronic files, which are used for solving the existing problems.
The invention discloses a secure transmission encryption method and system for electronic files, which adopts the following technical scheme:
the invention provides a secure transmission encryption method for electronic files, which comprises the following steps:
obtaining the frequencies of all characters in the electronic file, constructing a Huffman coding table according to the frequencies of all characters, and carrying out coding compression on the electronic file according to the Huffman coding table to obtain a coding compression result of the electronic file;
setting a key according to the chaotic map, and obtaining a conversion position sequence according to the key;
encrypting the encoding compression result of the electronic file according to the conversion position sequence to obtain a ciphertext of the electronic file;
and carrying out safe transmission on the ciphertext of the electronic file.
Further, the method for obtaining the ciphertext of the electronic file comprises the following specific steps:
s1, setting a counter S, wherein the initial value of the counter S is 0;
s2, the first step in the encoding compression result of the electronic fileBits are converted to obtain the encoding compression result of the converted electronic file, < >>Representing an S-th transition position in the sequence of transition positions; if the code compression result is +.>Bit 0, the first ++in the encoded compression result>Bit conversion to 1, if the first +.>Bit 1, the first ++in the encoded compression result>Bits are converted to 0;
s3, decoding the coding compression result of the converted electronic file according to the Huffman coding table from left to right, and decoding the front part of the decodingThe length of each code is required to meet 3 conditions;
s4, ifAnd->The counter S is added with 1, and the converted electricity is addedThe encoding compression result of the subfile is used as the encoding compression result of the new electronic file, S2 is executed, L represents the length of the encoding compression result of the electronic file, and Q represents the length of the conversion position sequence;
s5, repeating the steps S2 to S4 untilOr stopping when s=q, taking the coding compression result of the converted electronic file obtained at this time as ciphertext of the electronic file, and taking the counter S at this time as a stopping condition.
Further, the method for acquiring the 3 conditions specifically comprises the following steps:
condition 1: decoded frontSum of lengths of the codes and front +_ of the electronic document>The sum of the encoding lengths of the individual data is equal;
condition 2: decoded first-1 encoded length and +.>The encoded lengths of the individual data are not equal;
condition 3: decoded firstLength of the code and +.>The encoded lengths of the individual data are equal.
Further, the obtaining the conversion position sequence according to the key comprises the following specific steps:
obtaining all chaos values according to the secret key, and obtaining a conversion position sequence according to all chaos values, wherein the ith conversion position in the conversion position sequenceThe method comprises the following steps:
in the method, in the process of the invention,representing the i-th switch position in the sequence of switch positions, a>Represents the j-th chaotic value,>represents an upward rounding, C represents a maximum length;
wherein Q is the position of the last transition position in the sequence of transition positions, namely the Q-th transition positionL represents the length of the encoded compression result of the electronic file.
Further, the method for obtaining all chaos values according to the secret key comprises the following specific steps:
and taking the secret key as an initial value and a parameter of the one-dimensional Logistic mapping model, and iterating the one-dimensional Logistic mapping model Q times to obtain Q chaos values.
Further, the maximum length obtaining method specifically includes the following steps:
the maximum coding length in the huffman coding table is noted as the maximum length C.
Further, the key setting according to the chaotic map comprises the following specific steps:
model based on one-dimensional Logistic chaotic mappingGenerating a key, wherein->For initial value, < >>Is a parameter; due to the initial value->Parameter->When the system enters a chaotic state, 0,1 is generated]Chaos value between, thus, at +.>、/>Randomly generated within a range of (a)As a key.
Further, the construction of the Huffman coding table according to the frequencies of all the characters comprises the following specific steps:
and constructing a Huffman tree according to the frequencies of all the characters, and obtaining a Huffman coding table according to the Huffman tree.
Further, the secure transmission of the ciphertext of the electronic file comprises the following specific steps:
the sender transmits the ciphertext, the stop condition and the Huffman coding table of the obtained electronic file to the receiver; the receiving party obtains a conversion position sequence according to the secret key, converts the data of the corresponding position in the ciphertext of the electronic file according to the S conversion positions of the front stop condition in the conversion position sequence, decodes the converted ciphertext according to the Huffman coding table, and the obtained decoding result is the electronic file.
The invention further provides an electronic file secure transmission encryption system, which comprises an electronic file compression module, an electronic file encryption module, a sending end and a receiving end; the electronic file compression module and the electronic file encryption module are used for realizing the steps of the method; the sending end transmits the ciphertext, the stopping condition and the Huffman coding table of the obtained electronic file to the receiving end; the receiving end obtains a conversion position sequence according to the secret key, converts data of a corresponding position in ciphertext of the electronic file according to the conversion position sequence, and decodes the converted ciphertext according to the Huffman coding table to obtain the electronic file.
The technical scheme of the invention has the beneficial effects that: aiming at the problems that when the electronic file is subjected to encryption-before-encoding compression, the original statistical characteristics of the data are covered by the encryption operation, so that the encrypted data are difficult to encode and compress by using a conventional encoding compression method, the electronic file is encoded and compressed before encryption, the data in the electronic file are converted into a binary form after encoding and compression, and the conventional encryption method is not suitable for encrypting the data in the binary form; the invention uses the characteristic that Huffman coding belonging to the variable length coding has avalanche effect in decoding, namely if the length of the front decodable subsequence is obtained in error, the decoding of the rear data can be caused to be in error, the decoding result of the converted coding compression result is different from the original electronic file by converting the data of partial positions of the coding compression result of the electronic file, the converted coding compression result is transmitted, the confidentiality and the integrity of information in the electronic file are ensured, and the transmission efficiency of the electronic file is ensured while the unauthorized visitor is prevented from obtaining and tampering the file content.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart showing the steps of a method for encrypting an electronic file for secure transmission according to the present invention;
FIG. 2 is a system block diagram of an electronic file secure transmission encryption system according to the present invention;
fig. 3 is a huffman tree constructed according to the frequency number of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description refers to the specific implementation, structure, characteristics and effects of an electronic file secure transmission encryption method according to the invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the electronic file secure transmission encryption method provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of a method for encrypting secure transmission of an electronic file according to an embodiment of the present invention is shown, the method includes the following steps:
in addition, in huffman coding, which is an irregular length coding, when decoding a binary sequence, which is a result of coding compression, it is necessary to determine the length of a sub-sequence that can be decoded in the binary sequence from a coding table, and then perform decoding. Therefore, if the length of the previous decodable sub-sequence is obtained in error, the subsequent data decoding is caused to be in error, the result of the encoding compression of the huffman encoding has avalanche effect in decoding, and the embodiment uses the avalanche effect of the result of the encoding compression of the huffman encoding in decoding, and converts the data of part of the positions in the result of the encoding compression of the electronic file, so that the decoding result of the converted encoding compression result is different from the original electronic file, and the converted encoding compression result is transmitted, thereby ensuring the confidentiality and integrity of information in the electronic file, preventing unauthorized visitors from obtaining and tampering the file content, and ensuring the transmission efficiency of the electronic file.
It should be further noted that, for example, the electronic file is "D, B, E, a, E, C, B, a, D, B, E, a, B", which includes A, B, C, D, E total 5 characters, the occurrence frequencies are 4, 5, 1, 2, and 3, respectively, please refer to fig. 3, which shows that the huffman codes of the 5 characters are respectively: a is 10, B is 11, C is 010, D is 011, E is 00, the result of encoding and compressing the electronic file according to Huffman coding of 5 characters is 011111100100001011100111100101011, the 2,5,9,13,19,24,30 th bit is converted, the result of encoding and compressing after conversion is 001101101100101011000110100100011, when decoding the result of encoding and compressing after conversion according to Huffman coding of 5 characters, the result of encoding and compressing after conversion is 00,11,011,011,00,10,10,11,00,011,010,010,00,11 respectively, and the specific decoding result is E, A, D, D, E, A, A, B, E, D, C, C, E and A.
S001, obtaining the frequency of all characters in the electronic file, constructing a Huffman coding table according to the frequency of all characters, and carrying out coding compression on the electronic file according to the Huffman coding table to obtain a coding compression result of the electronic file.
It should be noted that, in order to ensure confidentiality and integrity of information in an electronic file, prevent an unauthorized visitor from acquiring and tampering with the file content, and ensure transmission efficiency of the electronic file, the present embodiment uses avalanche effect of huffman coding result in decoding, and designs an encryption method suitable for encrypting binary data after coding, and according to the encryption method of the present embodiment, the result of coding of the electronic file after coding by huffman coding is encrypted, so that the electronic file needs to be coded and compressed by huffman coding first.
Specifically, a Huffman tree is constructed according to the frequency of each character in the electronic file, a Huffman coding table is obtained according to the Huffman tree, the codes of all characters are included, and the maximum coding length is recorded as the maximum length C; the electronic file is encoded and compressed according to the Huffman encoding table, and a sequence formed by encoding all characters in the electronic file according to the sequence is recorded as an encoding and compressing result of the electronic file, and the essence of the encoding and compressing result of the electronic file is a binary sequence formed by 0 and 1.
For example, the electronic file is "D, B, E, a, E, C, B, a, D, B, E, a, B", which includes A, B, C, D, E total 5 characters, the frequency of occurrence is 4, 5, 1, 2, 3, respectively, please refer to fig. 3, which shows the huffman tree constructed according to the frequency of occurrence in this embodiment, the huffman codes of the 5 characters are respectively: a is 10, B is 11, C is 010, D is 011, E is 00, and the result of encoding and compressing the electronic file according to Huffman encoding of 5 characters is 011111100100001011100111100101011.
S002, setting a key according to the chaotic map, and obtaining a conversion position sequence according to the key.
It should be noted that, the Logistic chaotic map has pseudo-randomness, sensitivity to initial conditions, aperiodicity and long-term unpredictability, and is suitable for encrypting data with large data size, so that the Logistic chaotic map is often used for a key generator.
Specifically, a model according to one-dimensional Logistic chaotic mappingGenerating a key, wherein->For initial value, < >>Is a parameter; due to the initial value->Parameter->When the system enters a chaotic state, 0,1 is generated]Chaos value between, thus, at +.>、/>Randomly generated within a range of (a) a group +.>As a key.
It should be noted that, the key is agreed by the file sender and the file receiver before transmitting the electronic file, and the key is not required to be transmitted, so that the key is prevented from being stolen by an attacker in the transmission process, the security of the key is ensured, and the security of the transmitted electronic file is further ensured.
It should be further noted that, in this embodiment, the key is used as an initial value and a parameter of the one-dimensional logical chaotic mapping, so as to obtain a position sequence composed of positions for converting the encoding and compressing result of the electronic file, and it is required that the last position cannot exceed the length range of the encoding and compressing result of the electronic file.
Further, taking the secret key as an initial value and a parameter of a one-dimensional Logistic mapping model, iterating the one-dimensional Logistic mapping model Q times to obtain Q chaotic values, and obtaining a conversion position sequence according to all the chaotic values, wherein the ith conversion position in the conversion position sequenceThe method comprises the following steps:
in the method, in the process of the invention,representing the i-th switch position in the sequence of switch positions, a>Represents the j-th chaotic value,>represents an upward rounding and C represents a maximum length.
Wherein Q is the conversion bitThe last transition position in the sequence, i.e. the Q-th transition positionL represents the length of the encoded compression result of the electronic file.
S003, encrypting the encoding compression result of the electronic file according to the conversion position sequence to obtain the ciphertext of the encoding compression result of the electronic file.
In addition, in huffman coding, which is an irregular length coding, when decoding a binary sequence, which is a result of coding compression, it is necessary to determine the length of a sub-sequence that can be decoded in the binary sequence from a coding table, and then perform decoding. Therefore, if the length of the previous decodable sub-sequence is obtained in error, the subsequent data decoding is caused to be in error, the result of the encoding compression of the huffman encoding has avalanche effect in decoding, and the embodiment uses the avalanche effect of the result of the encoding compression of the huffman encoding in decoding, and converts the data of part of the positions in the result of the encoding compression of the electronic file, so that the decoding result of the converted encoding compression result is different from the original electronic file, and the converted encoding compression result is transmitted, thereby ensuring the confidentiality and integrity of information in the electronic file, preventing unauthorized visitors from obtaining and tampering the file content, and ensuring the transmission efficiency of the electronic file.
It should be further noted that, since huffman coding belongs to an indefinite length coding, when decoding a binary sequence which is a result of coding compression, it is necessary to determine the length of a decodable sub-sequence in the binary sequence according to a coding table, and therefore, when converting data of a partial position in the result of coding compression of an electronic file so that the decoding result of the converted result of coding compression is different from an original electronic file, if the length of a certain decodable code is equal to the coding length of corresponding data in the electronic file, the decoding result is the same as the data of the electronic file, resulting in that the effect of encrypting the electronic file is not achieved; for example, as for the result of encoding compression of the electronic file "011111100100001011100111100101011", when the encoding compression result of the converted electronic file obtained after converting the 2 nd bit and the 5 th bit thereof is "001101100100001011100111100101011", the encoded lengths are "00,11,011,00,10,00,010, …,11", respectively, upon decoding the encoding compression result of the converted electronic file, the encoded length from the 4 th encoding start length is equal to the encoded length of the 4 th data of the electronic file, resulting in the same subsequent decoding result as the data of the electronic file, and the effect of encrypting the electronic file is not achieved. Therefore, it is necessary to control the amount of data converted in the encryption method by the encoding length of the decoding result.
Specifically, the method encrypts the encoding compression result of the electronic file according to the conversion position sequence to obtain the ciphertext of the encoding compression result of the electronic file, and specifically comprises the following steps:
s1, setting a counter S, wherein the initial value of the counter S is 0;
s2, the first step in the encoding compression result of the electronic fileBits are converted to obtain the encoding compression result of the converted electronic file, < >>Representing an S-th transition position in the sequence of transition positions; if the code compression result is +.>Bit 0, the first ++in the encoded compression result>Bit conversion to 1, if the first +.>Bit 1, the first ++in the encoded compression result>Bits are converted to 0;
s3, according to the jojobaA Froman code table for decoding the coded compression result of the converted electronic file in the order from left to right and decoding the previous decoded fileThe length of the code (i.e. the front +.Can be found in the code table)>Length of the codes), the following 3 conditions are required to be satisfied:
condition 1: decoded frontSum of lengths of the codes and front +_ of the electronic document>The sum of the encoding lengths of the individual data is equal;
condition 2: decoded first-1 encoded length and +.>The encoded lengths of the individual data are not equal;
condition 3: decoded firstLength of the code and +.>The encoded lengths of the individual data are equal;
s4, ifAnd->Adding 1 to the counter S, taking the converted encoding compression result of the electronic file as the encoding compression result of the new electronic file, and executing S2, wherein L represents the encoding compression of the electronic fileThe length of the scaled result, Q, represents the length of the sequence of conversion positions.
S5, repeating the steps S2 to S4 untilOr stopping when s=q, taking the coding compression result of the converted electronic file obtained at this time as ciphertext of the electronic file, and taking the counter S at this time as a stopping condition.
For example, the result of encoding and compressing the electronic file "D, B, E, a, E, C, B, a, D, B, E, a, B" is "011,11,11,00,10,00,010,11,10,011,1100101011", and the result of encoding and compressing the electronic file is encrypted according to the conversion position sequence {2,5,9,13,19,24,30}, specifically:
at the first cycle: after converting the 2 nd bit in the coding compression result of the electronic file, the coding compression result of the converted electronic file is 001111100100001011100111100101011; decoding the encoding and compression results of the converted electronic file in the order from left to right according to the Huffman encoding table, and decoding the front partThe length of the code satisfies 3 conditions, in which case +.>Continuing the circulation operation;
the second cycle is that: the encoding compression result of the new electronic file is 001111100100001011100111100101011, after converting the 5 th bit in the encoding compression result of the electronic file, the encoding compression result of the converted electronic file is 001101100100001011100111100101011, and the encoding compression result of the electronic file is the decoding result before decodingThe length of the code satisfies 3 conditions, in which case +.>Continuing the circulation operation;
third cycle: encoding compression of new electronic filesThe result is 001101100100001011100111100101011, after 9 th bit in the result of encoding and compressing the electronic file is converted, the result of encoding and compressing the converted electronic file is 001101101100001011100111100101011, and the result of encoding and compressing the electronic file is the decoding result before decodingThe length of the code satisfies 3 conditions, in which case +.>Continuing the circulation operation;
and so on, until the 13,19,24,30 th bit is converted, the converted result of the encoding compression is 001101101100101011000110100100011, and when the converted result of the encoding compression is decoded according to Huffman encoding of 5 characters, the converted result is 00,11,011,011,00,10,10,11,00,011,010,010,00,11 respectively, and the specific decoding result is E, A, D, D, E, A, A, B, E, D, C, C, E and A.
S004, the ciphertext of the electronic file is transmitted safely.
Specifically, the sender transmits the ciphertext, the stop condition and the Huffman coding table of the obtained electronic file to the receiver; the receiving party obtains a conversion position sequence according to the secret key, converts the data of the corresponding position in the ciphertext of the electronic file according to the S conversion positions of the front stop condition in the conversion position sequence, decodes the converted ciphertext according to the Huffman coding table, and the obtained decoding result is the electronic file.
Referring to fig. 2, a system block diagram of an electronic file secure transmission encryption system according to an embodiment of the present invention is shown, where the system includes an electronic file compression module, an electronic file encryption module, a sending end and a receiving end, and specifically includes:
the electronic file compression module is used for realizing the step of the S001 method;
the electronic file encryption module is used for realizing the steps of the methods from S002 to S003;
the sending end transmits the ciphertext, the stopping condition and the Huffman coding table of the obtained electronic file to the receiving end;
the receiving end obtains a conversion position sequence according to the secret key, converts data of a corresponding position in ciphertext of the electronic file according to the conversion position sequence, and decodes the converted ciphertext according to the Huffman coding table to obtain the electronic file.
Aiming at the problems that when the electronic file is subjected to encryption-before-encoding compression, the original statistical characteristics of the data are covered by the encryption operation, so that the encrypted data are difficult to encode and compress by using a conventional encoding compression method, the electronic file is encoded and compressed before encryption, the data in the electronic file are converted into a binary form after encoding and compression, and the conventional encryption method is not suitable for encrypting the data in the binary form; the invention uses the characteristic that Huffman coding belonging to the variable length coding has avalanche effect in decoding, namely if the length of the front decodable subsequence is obtained in error, the decoding of the rear data can be caused to be in error, the decoding result of the converted coding compression result is different from the original electronic file by converting the data of partial positions of the coding compression result of the electronic file, the converted coding compression result is transmitted, the confidentiality and the integrity of information in the electronic file are ensured, and the transmission efficiency of the electronic file is ensured while the unauthorized visitor is prevented from obtaining and tampering the file content.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (8)

1. A method for securely transmitting and encrypting an electronic document, comprising the steps of:
obtaining the frequencies of all characters in the electronic file, constructing a Huffman coding table according to the frequencies of all characters, and carrying out coding compression on the electronic file according to the Huffman coding table to obtain a coding compression result of the electronic file;
setting a key according to the chaotic map, and obtaining a conversion position sequence according to the key;
encrypting the encoding compression result of the electronic file according to the conversion position sequence to obtain a ciphertext of the electronic file;
carrying out safe transmission on ciphertext of the electronic file;
the method for obtaining the ciphertext of the electronic file comprises the following specific steps:
s1, setting a counter S, wherein the initial value of the counter S is 0;
s2, the first step in the encoding compression result of the electronic fileBits are converted to obtain the encoding compression result of the converted electronic file, < >>Representing an S-th transition position in the sequence of transition positions; if the code compression result is +.>Bit 0, the first ++in the encoded compression result>Bit conversion to 1, if the first +.>Bit 1, the first ++in the encoded compression result>Bits are converted to 0;
s3, decoding the coding compression result of the converted electronic file according to the Huffman coding table from left to right, and decoding the front part of the decodingThe length of each code is required to meet 3 conditions;
s4, ifAnd->Adding 1 to the counter S, taking the coding compression result of the converted electronic file as the coding compression result of the new electronic file, executing S2, wherein L represents the length of the coding compression result of the electronic file, and Q represents the length of the conversion position sequence;
s5, repeating the steps S2 to S4 untilOr stopping when s=q, taking the coding compression result of the converted electronic file obtained at the moment as the ciphertext of the electronic file, and taking the counter S at the moment as a stopping condition;
the method for acquiring the 3 conditions comprises the following steps:
condition 1: decoded frontSum of lengths of the codes and front +_ of the electronic document>The sum of the encoding lengths of the individual data is equal;
condition 2: decoded first-1 encoded length and +.>The encoded lengths of the individual data are not equal;
condition 3: decoded firstLength of the code and +.>Personal dataThe encoded lengths of (2) are equal.
2. The method for encrypting the secure transmission of electronic files according to claim 1, wherein said obtaining the sequence of conversion locations based on the key comprises the specific steps of:
obtaining all chaos values according to the secret key, and obtaining a conversion position sequence according to all chaos values, wherein the ith conversion position in the conversion position sequenceThe method comprises the following steps:
in the method, in the process of the invention,representing the i-th switch position in the sequence of switch positions, a>Represents the j-th chaotic value,>represents an upward rounding, C represents a maximum length;
where Q represents the length of the sequence of conversion positions and L represents the length of the encoded compression result of the electronic file.
3. The method for securely transmitting and encrypting the electronic file according to claim 2, wherein said obtaining all chaos values according to the key comprises the following steps:
and taking the secret key as an initial value and a parameter of the one-dimensional Logistic mapping model, and iterating the one-dimensional Logistic mapping model Q times to obtain Q chaos values.
4. The method for securely transmitting and encrypting the electronic file according to claim 2, wherein the maximum length obtaining method comprises the following steps:
the maximum coding length in the huffman coding table is noted as the maximum length C.
5. The method for securely transmitting and encrypting the electronic file according to claim 1, wherein the step of setting the key according to the chaotic map comprises the following specific steps:
model based on one-dimensional Logistic chaotic mappingGenerating a key, wherein->For initial value, < >>Is a parameter; due to the initial value->Parameter->When the system enters a chaotic state, 0,1 is generated]Chaos value between, thus, at +.>、/>Randomly generated within a range of (a)As a key.
6. The method for encrypting the secure transmission of electronic files according to claim 1, wherein said constructing a huffman coding table according to the frequencies of all characters comprises the following specific steps:
and constructing a Huffman tree according to the frequencies of all the characters, and obtaining a Huffman coding table according to the Huffman tree.
7. The method for securely transmitting and encrypting the ciphertext of the electronic file according to claim 1, comprising the specific steps of:
the sender transmits the ciphertext, the stop condition and the Huffman coding table of the obtained electronic file to the receiver; the receiving party obtains a conversion position sequence according to the secret key, converts the data of the corresponding position in the ciphertext of the electronic file according to the first S conversion positions in the conversion position sequence, decodes the converted ciphertext according to the Huffman coding table, and the obtained decoding result is the electronic file.
8. The electronic file safe transmission encryption system is characterized by comprising an electronic file compression module, an electronic file encryption module, a sending end and a receiving end; the electronic file compression module and the electronic file encryption module are used for realizing the steps of the electronic file secure transmission encryption method according to any one of claims 1 to 6; the sending end transmits the ciphertext, the stopping condition and the Huffman coding table of the obtained electronic file to the receiving end; the receiving end obtains a conversion position sequence according to the secret key, converts data of a corresponding position in the ciphertext of the electronic file according to the conversion position sequence, and decodes the converted ciphertext according to the Huffman coding table to obtain the electronic file.
CN202311034047.5A 2023-08-17 2023-08-17 Electronic file secure transmission encryption method and system Active CN116781420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311034047.5A CN116781420B (en) 2023-08-17 2023-08-17 Electronic file secure transmission encryption method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311034047.5A CN116781420B (en) 2023-08-17 2023-08-17 Electronic file secure transmission encryption method and system

Publications (2)

Publication Number Publication Date
CN116781420A CN116781420A (en) 2023-09-19
CN116781420B true CN116781420B (en) 2023-10-24

Family

ID=88008367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311034047.5A Active CN116781420B (en) 2023-08-17 2023-08-17 Electronic file secure transmission encryption method and system

Country Status (1)

Country Link
CN (1) CN116781420B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980629B (en) * 2023-09-25 2024-01-30 深圳市银河通信科技有限公司 Automatic fault detection system for large-scale lighting system
CN117034865B (en) * 2023-10-09 2024-01-16 青岛畅通市政工程设计有限公司 Municipal engineering design data optimization processing method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465724A (en) * 2009-01-06 2009-06-24 中国科学院软件研究所 Encrypted Huffman encoding method and decoding method
CN102915519A (en) * 2012-09-12 2013-02-06 东北林业大学 Algorithm for encrypting image on basis of chaotic mapping and series changing
CN106027062A (en) * 2015-05-11 2016-10-12 上海兆芯集成电路有限公司 Hardware data compressor that directly huffman encodes output tokens from lz77 engine
CN115297363A (en) * 2022-10-09 2022-11-04 南通商翼信息科技有限公司 Video data encryption transmission method based on Huffman coding
CN116506073A (en) * 2023-06-26 2023-07-28 深圳市研创科技有限公司 Industrial computer platform data rapid transmission method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11550756B2 (en) * 2017-10-30 2023-01-10 AtomBeam Technologies Inc. System and method for error-resilient data reduction

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465724A (en) * 2009-01-06 2009-06-24 中国科学院软件研究所 Encrypted Huffman encoding method and decoding method
CN102915519A (en) * 2012-09-12 2013-02-06 东北林业大学 Algorithm for encrypting image on basis of chaotic mapping and series changing
CN106027062A (en) * 2015-05-11 2016-10-12 上海兆芯集成电路有限公司 Hardware data compressor that directly huffman encodes output tokens from lz77 engine
CN115297363A (en) * 2022-10-09 2022-11-04 南通商翼信息科技有限公司 Video data encryption transmission method based on Huffman coding
CN116506073A (en) * 2023-06-26 2023-07-28 深圳市研创科技有限公司 Industrial computer platform data rapid transmission method and system

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
一种基于无损压缩和混沌序列的文本加密算法;李太勇;吴江;周敏;;网络安全技术与应用(11);73-74 *
基于混沌序列的压缩图像加密算法;彭成;柳林;;计算机工程(20);177-179 *
彭成 ; 柳林 ; .基于混沌序列的压缩图像加密算法.计算机工程.2008,(20),177-179. *
李太勇 ; 吴江 ; 周敏 ; .一种基于无损压缩和混沌序列的文本加密算法.网络安全技术与应用.2008,(11),73-74. *
混沌权值变异的Huffman树图像加密算法;龙敏等;小型微型计算机系统;第3节 *

Also Published As

Publication number Publication date
CN116781420A (en) 2023-09-19

Similar Documents

Publication Publication Date Title
CN116781420B (en) Electronic file secure transmission encryption method and system
US6122379A (en) Method and apparatus for performing simultaneous data compression and encryption
CN109657769B (en) Two-dimensional code information hiding method based on run length coding
CN116032474B (en) Safety protection system based on big data computer network
CN115865523B (en) Data encryption transmission method for information analysis system
CN101677399A (en) Method and system for encoding multimedia content based on secure coding schemes using stream cipher
CN110011993B (en) Two-dimensional code big data safety transmission device based on developments multistage encryption and decryption
CN116108506B (en) Meta-universe digital asset security management system
CN115659409B (en) Financial asset transaction data safe storage method
CN116094836B (en) Router data secure storage method and system based on symmetric encryption
CN115941189B (en) Encryption method for document data
CN115426101B (en) Data transmission method of cloud intercommunication platform
CN116471007A (en) Network information encryption transmission method based on cloud platform
CN110717151A (en) Digital fingerprint processing and signature processing method
SubhamastanRao et al. Simultaneous data compression and encryption
CN108235022A (en) A kind of computer video data processing method
CN115333720B (en) Data transmission method for call center
Suresh et al. Separable reversible data hiding using Rc4 algorithm
Ryabko et al. Asymptotically optimal perfect steganographic systems
CN103178968A (en) Encryption method of data transmission threshold scheme based on Huffman compression
CN100555937C (en) A kind of E-mail encryption transmitting-receiving system
CN109787719A (en) A kind of polarization secure coding method of probability relaying auxiliary
Kumar et al. Data hiding scheme for medical images using lossless code for mobile HIMS
Mani et al. Enhancing security in cryptographic algorithm based on LECCRS
CN117319041B (en) Network communication data encryption transmission method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant