[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111371751B - File stream byte group data encryption and network transmission method - Google Patents

File stream byte group data encryption and network transmission method Download PDF

Info

Publication number
CN111371751B
CN111371751B CN202010110805.7A CN202010110805A CN111371751B CN 111371751 B CN111371751 B CN 111371751B CN 202010110805 A CN202010110805 A CN 202010110805A CN 111371751 B CN111371751 B CN 111371751B
Authority
CN
China
Prior art keywords
array
file
byte
logistic
sequence
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
CN202010110805.7A
Other languages
Chinese (zh)
Other versions
CN111371751A (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.)
Tianyuan Big Data Credit Management Co Ltd
Original Assignee
Tianyuan Big Data Credit Management 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 Tianyuan Big Data Credit Management Co Ltd filed Critical Tianyuan Big Data Credit Management Co Ltd
Priority to CN202010110805.7A priority Critical patent/CN111371751B/en
Publication of CN111371751A publication Critical patent/CN111371751A/en
Application granted granted Critical
Publication of CN111371751B publication Critical patent/CN111371751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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/002Countermeasures against attacks on cryptographic mechanisms
    • 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/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3

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)

Abstract

The invention relates to the field of file transmission, and particularly provides a method for encrypting file stream byte data and transmitting the file stream byte data through a network. The invention relates to a method for encrypting byte array data of a file stream and transmitting the data through a network, which is characterized in that a file to be encrypted is read in a file stream mode to obtain a file stream byte array a of the file; carrying out one round of XOR processing on the array a and the logical mapping iteration value to obtain a new file stream byte array b; scrambling the array b, sequencing the sequence by using a logistic iteration sequence, and replacing the array b according to the logistic sequence to obtain a new byte array c; in turn, BASE64 encoding is performed on the finally obtained byte array to obtain the character string to be transmitted. Compared with the prior art, the invention encrypts the byte stream, so that the converted new coding byte has higher information entropy and lower byte relevance, is used for resisting statistical attack and inscription attack, provides guarantee for network transmission safety, and has good popularization value.

Description

File stream byte group data encryption and network transmission method
Technical Field
The invention relates to the field of file transmission, and particularly provides a method for encrypting file stream byte data and transmitting the file stream byte data through a network.
Background
With the continuous expansion of the network ecological environment, the network transmission loophole is utilized by people, and the monitoring of the network is started to cause important information leakage, so that events which cause serious loss to individuals and enterprises frequently occur. Therefore, network transmission security is more and more emphasized, and network file transmission security is also more and more concerned.
Many experts, scholars and engineers have conducted intensive research on encryption of transmission files, some realize encryption of personal file transmission, some improve security of file transmission, and some realize online editing of files to enhance security of files. However, in general, further improvement in security of documents is required.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for encrypting the byte group data of the file stream and transmitting the data through a network, which has strong practicability.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a file stream byte array data encryption and network transmission method reads a file to be encrypted in a file stream mode to obtain a file stream byte array a of the file; carrying out one round of XOR processing on the array a and the logical mapping iteration value to obtain a new file stream byte array b; scrambling the array b, sequencing the sequence by using a logistic iteration sequence, and replacing the array b according to the logistic sequence to obtain a new byte array c; and carrying out internal XOR on the array c to obtain a new byte array d, carrying out scrambling processing on the array d, sequencing by using a logistic iterative sequence, replacing the log array d according to the logistic sequence to obtain a new byte array e, repeating the processing of the a-e for n times on the log array e, and carrying out BASE64 encoding on the finally obtained byte array f to obtain a character string to be transmitted.
Furthermore, the iteration times of the initial value of the logistic mapping are given by a user, the logistic sequence is replaced by global replacement, the XOR between the arrays is the XOR between the corresponding positions between the two arrays, the XOR rule in the arrays is the XOR of the current bit and the last two bits simultaneously, the XOR of the last bit and the first two bits simultaneously, and the XOR of the last bit and the adjacent two bits.
Further, the original byte stream array and the logistic sequence are subjected to exclusive OR according to the same position, the new array is subjected to the logistic sequence replacement, the new array is subjected to exclusive OR processing according to the last two bits, then the array is subjected to global replacement, and n times of circular encryption is performed according to the same encryption mode.
Preferably, the number of times of the round robin encryption is determined by the size of the file to be encrypted.
Further, reading a file to be encrypted in a file stream mode to obtain a file stream byte array a of the file, wherein the value of each bit in the array a is an integer of-128 to 127;
performing one round of XOR processing on the array a and the logistic mapping iterative conversion value, and giving 3.6 < a0< 4 and an iteration initial value of 0 < x1< 1, iterating the sequence x using logisticn+1=α0*xn(1-xn) Mapping the obtained value of the logistic iteration sequence array to an array of integers with the value range of-128 to 0, namely:
Xn=[128*(xn-1)]([]get the whole)
And carrying out bitwise XOR on the newly obtained integer array (X) and the original file stream byte array a, namely:
Figure BDA0002389924600000021
tuple b is available.
Further, the array b is scrambled, given 3.6 < alpha1< 4 and an iteration initial value of 0 < x1 2< 1, iteration sequence x using logisticn+1=α1*xn(1-xn) And generating a new array, sequencing the array, reserving the index value of the sequenced corresponding value in the original value to obtain an index array temp, and replacing the array b according to the index array temp to obtain an array c.
Further, the internal self-XOR processing is performed on the array c to make the current bit of the array and the next two bits adjacent to the current bit of the array perform XOR operation simultaneously to obtain an array d,
when n is less than or equal to len-2:
Figure BDA0002389924600000022
when n ═ len-1:
Figure BDA0002389924600000023
when n ═ len:
Figure BDA0002389924600000024
further, replacing elements in the d array of the log array d according to an index array generated by locality to obtain an array e, repeating the a-e operation for n times according to the file size to obtain an array f, and encoding the obtained array f by using BASE64 to obtain a character string to be transmitted.
Preferably, when the file is larger than 1Mb, n is 1; when the encrypted file is less than 1Mb, n is 10.
Compared with the prior art, the file stream byte group data encryption and network transmission method has the following outstanding beneficial effects:
the scheme is mainly used for encrypting the file from the aspect of byte stream aiming at the problem of network file transmission safety, so that the converted new coding byte has higher information entropy and lower byte association degree, is used for resisting statistical attack and inscription attack, and provides guarantee for network transmission safety.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a statistical chart of characters of a transmission string obtained without processing;
FIG. 2 is a transmission string character statistic obtained after processing by the present invention;
FIG. 3 is a block diagram of raw source file bytecode statistics obtained without processing;
FIG. 4 is a processed bytecode statistics map of the invention.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments in order to better understand the technical solutions of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A preferred embodiment is given below:
as shown in fig. 1, 2, 3, and 4, in the file stream byte group data encryption and network transmission method in this embodiment, a file to be encrypted is read in a file stream manner, so as to obtain a file stream byte group a of the file; carrying out one round of XOR processing on the array a and the logical mapping iteration value to obtain a new file stream byte array b; scrambling the array b, sequencing the sequence by using a logistic iteration sequence, and replacing the array b according to the logistic sequence to obtain a new byte array c; and carrying out internal XOR on the array c to obtain a new byte array d, carrying out scrambling processing on the array d, sequencing by using a logistic iterative sequence, replacing the log array d according to the logistic sequence to obtain a new byte array e, repeating the processing of the a-e for n times on the log array e, and carrying out BASE64 encoding on the finally obtained byte array f to obtain a character string to be transmitted.
The iteration times of the initial value of the logistic mapping are given by a user, the logistic sequence is replaced by global replacement, the XOR between the arrays is the XOR between the corresponding positions between the two arrays, the XOR rule in the arrays is the XOR of the current bit and the last two bits simultaneously, the XOR of the last bit and the first two bits, and the XOR of the last bit and the adjacent two bits.
The method comprises the steps of firstly carrying out exclusive OR on an original byte stream array and a logistic sequence according to parity, replacing the new array by the logistic sequence, carrying out exclusive OR on the new array according to the last two bits, carrying out global replacement on the array, and carrying out n-time circular encryption according to the same encryption mode. The number of times of the round robin encryption is determined by the size of the file to be encrypted.
The following were used:
reading a file to be encrypted in a file stream mode to obtain a file stream byte array a of the file, wherein the value of each bit in the array a is an integer of-128 to 127; and carrying out one round of XOR processing on the array a and the logistic mapping iterative conversion value in the following processing mode: for a given 3.6<a0<4 and an iteration initial value of 0<x1<1, iterating the sequence x using logisticn+1=α0*xn(1-xn) Mapping the obtained value of the logistic iteration sequence array to an array of integers (conveniently exclusive-or with a) with the value range of-128 to 0, wherein the processing mode is as follows:
Xn=[128*(xn-1)]([]get the whole)
And carrying out bitwise XOR on the newly obtained integer array (X) and the original file stream byte array a, namely:
Figure BDA0002389924600000041
tuple b is available.
Scramble array b, given 3.6<α1<4 and an iteration initial value of 0<x1 2<1, iterating the sequence x using logisticn+1=α1*xn(1-xn) Generating a new array temp, sorting the whole array temp, and reserving the index value (position in the original array temp) of the sorted corresponding numerical value in the original array (temp) to obtain an index array;
Figure BDA0002389924600000051
subscript (position) of each value in original array after temp ordering
Replacing the array b according to the index array to obtain an array c
Namely, it is
Figure BDA0002389924600000052
That is, it is
Subscript i 1 2 3 4 5 6
b array 13 -22 11 10 3 120
temp array 1 3 2 4 6 5
c array 13 11 -22 10 120 3
The ith temp [ i ] bit of the array (the value of the ith bit of the temp index array) is placed on the ith bit of the c array, and the array c is subjected to XOR processing to obtain a new byte array d, wherein the processing mode is as follows: and performing exclusive OR operation on the current bit and the adjacent last two bits at the same time, performing a new round of scrambling processing on the log group d to obtain a new array e, and repeating the operation of a-e on the log group e according to the size of the encrypted file to obtain an array f.
The obtained array f is subjected to BASE64 coding to obtain a character string to be transmitted.
The above embodiments are only specific cases of the present invention, and the protection scope of the present invention includes but is not limited to the above embodiments, and any suitable changes or substitutions by those skilled in the art and the encryption and network transmission methods of the file stream byte group data according to the claims of the present invention shall fall within the protection scope of the present invention.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (1)

1. A file stream byte group data encryption and network transmission method is characterized in that a file to be encrypted is read in a file stream mode to obtain a file stream byte array a of the file; carrying out one round of XOR processing on the array a and the logical mapping iteration value to obtain a new file stream byte array b; scrambling the array b, sequencing the sequence by using a logistic iteration sequence, and replacing the array b according to the logistic sequence to obtain a new byte array c; carrying out internal XOR on the array c to obtain a new byte array d, carrying out scrambling processing on the array d, sequencing by using a logistic iterative sequence, replacing the array d according to the logistic sequence to obtain a new byte array e, repeating the processing of the a-e for n times on the array e, and carrying out BASE64 coding on the finally obtained byte array f to obtain a character string to be transmitted;
the iteration times of the initial value of the logistic mapping are given by a user, the logistic sequence is replaced by global replacement, the XOR among the arrays is the XOR between the corresponding positions of the two arrays, the XOR rule in the arrays is the XOR of the current bit and the last two bits at the same time, the XOR of the last bit and the first two bits, and the XOR of the second last bit and the adjacent two bits;
firstly, carrying out exclusive OR on an original byte stream array and a logistic sequence according to parity, replacing a newly obtained array according to the logistic sequence, carrying out exclusive OR processing on the newly obtained array according to the last two bits at the same time, carrying out global replacement on the array, and carrying out n-time cyclic encryption according to the same encryption mode;
the number of times of the circular encryption is determined by the size of the file to be encrypted;
reading a file to be encrypted in a file stream mode to obtain a file stream byte array a of the file, wherein the value of each bit in the array a is an integer of-128 to 127;
the array a and the logistic mapping iterative conversion value are subjected to one round of XOR processing, and the given 3.6<
Figure 860074DEST_PATH_IMAGE001
<4 and iteration initial value 0<
Figure 263373DEST_PATH_IMAGE002
<1, iterative sequence Using logistic
Figure 787895DEST_PATH_IMAGE003
,
Mapping the obtained value of the logistic iteration sequence array to an array of integers with the value range of-128 to 0, namely:
Figure 338962DEST_PATH_IMAGE004
,[]representing rounding;
carrying out bitwise XOR on the newly obtained integer array (X) and the original file stream byte array a
Namely:
Figure DEST_PATH_IMAGE005
byte group b can be obtained;
scramble array b, given 3.6<
Figure 341553DEST_PATH_IMAGE006
<4 and an iteration initial value of 0<
Figure 396097DEST_PATH_IMAGE007
<1, iterative sequence Using logistic
Figure 622679DEST_PATH_IMAGE008
Generating a new array, sequencing the array, reserving an index value of a sequenced corresponding numerical value in an original numerical value to obtain an index array temp, and replacing the array b according to the index array temp to obtain an array c;
performing internal self-XOR processing on the array c to make the current bit of the array and the next two adjacent bits perform XOR operation simultaneously to obtain an array d,
Figure 395463DEST_PATH_IMAGE009
Figure 405007DEST_PATH_IMAGE010
Figure 579637DEST_PATH_IMAGE011
Figure 213006DEST_PATH_IMAGE012
represents an integer value that is,
Figure 473086DEST_PATH_IMAGE013
representing the length of an array;
replacing the internal elements of the array d according to the index array generated by the array d according to the locality to obtain an array e, repeating the a-e operation for n times according to the file size to obtain an array f, and encoding the obtained array f by using BASE64 to obtain a character string to be transmitted;
when the file is greater than 1Mb, n = 1; n =10 when the encrypted file is less than 1 Mb.
CN202010110805.7A 2020-02-24 2020-02-24 File stream byte group data encryption and network transmission method Active CN111371751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010110805.7A CN111371751B (en) 2020-02-24 2020-02-24 File stream byte group data encryption and network transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010110805.7A CN111371751B (en) 2020-02-24 2020-02-24 File stream byte group data encryption and network transmission method

Publications (2)

Publication Number Publication Date
CN111371751A CN111371751A (en) 2020-07-03
CN111371751B true CN111371751B (en) 2022-06-14

Family

ID=71209718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010110805.7A Active CN111371751B (en) 2020-02-24 2020-02-24 File stream byte group data encryption and network transmission method

Country Status (1)

Country Link
CN (1) CN111371751B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113382004A (en) * 2021-06-10 2021-09-10 浪潮卓数大数据产业发展有限公司 File encryption method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5365589A (en) * 1992-02-07 1994-11-15 Gutowitz Howard A Method and apparatus for encryption, decryption and authentication using dynamical systems
JP2001285276A (en) * 2000-04-03 2001-10-12 Yazaki Corp Stream encryption method, decoding method, and encryption communication system
CN103532701B (en) * 2013-10-16 2014-09-10 南通纺织职业技术学院 Encryption and decryption method for numeric type data
CN109951240B (en) * 2019-03-25 2020-05-26 北京航空航天大学 Polar code-based secure physical layer communication transmission method of wiretap channel

Also Published As

Publication number Publication date
CN111371751A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN113225449A (en) Image encryption method based on chaos sequence and DNA coding
Wong et al. Simultaneous arithmetic coding and encryption using chaotic maps
CN101383703B (en) Dynamic ciphering method based on broad sense information field
CN113194213B (en) PNG image information hiding and recovering method based on secret sharing and chaotic mapping
CN102523365B (en) Method for encrypting and decrypting image based on cellular automata
CN107659751B (en) Multi-image encryption method based on DNA coding and chaos
CN113297606A (en) Color quantum image encryption and decryption method based on multiple chaos and DNA operation
CN101394268B (en) Advanced ciphering system and method based on broad sense information field
CN108197484B (en) Method for realizing node data security in distributed storage environment
CN115085924A (en) Computer information transmission encryption system based on Huffman coding
CN116488814A (en) FPGA-based data encryption secure computing method
CN111371751B (en) File stream byte group data encryption and network transmission method
CN115834023B (en) Data encryption method based on big data
Hameed et al. Modified Vigenère cipher algorithm based on new key generation method
CN111027081B (en) Text carrierless information hiding method based on feature mapping
CN108521534A (en) More image encryption methods based on DNA encoding and old hyperchaos
CN101022331A (en) Chaos encrypting method based on carrier
CN116961904B (en) Enterprise information image encryption method based on double scrambling and controlled DNA coding
Dhane et al. A novel high capacity reversible data hiding through encryption scheme by permuting encryption key and entropy analysis
CN117527984A (en) Image encryption method based on sine and cosine two-dimensional chaotic system
CN114422230B (en) Information transmission system based on data encryption
CN114244489B (en) Image encryption method based on radial diffusion
GÜRFİDAN et al. A New Hybrid Encryption Approach for Secure Communication: GenComPass
CN107896143B (en) Joint coding method based on high-dimensional chaotic system and arithmetic coding
CN114710264A (en) Physical layer encryption and decryption method and system based on Spinal code

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220519

Address after: 23 / F, S01 building, Langchao Science Park, 1036 Langchao Road, high tech Zone, Jinan City, Shandong Province, 250100

Applicant after: Tianyuan big data Credit Management Co.,Ltd.

Address before: Room 3110, S01 / F, Inspur building, 1036 Inspur Road, hi tech Zone, Jinan City, Shandong Province 250100

Applicant before: Shandong Aicheng Network Information Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant