CN105959118A - Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers - Google Patents
Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers Download PDFInfo
- Publication number
- CN105959118A CN105959118A CN201610279725.8A CN201610279725A CN105959118A CN 105959118 A CN105959118 A CN 105959118A CN 201610279725 A CN201610279725 A CN 201610279725A CN 105959118 A CN105959118 A CN 105959118A
- Authority
- CN
- China
- Prior art keywords
- pointer
- key
- ciphertext
- file
- key indicator
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/065—Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
- H04L9/0656—Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers. The method comprises the steps of: developing a memory space, carrying out initialization, and arranging preset values; generating a corresponding first pointer and second pointer; operating an algorithm program and reading displacements of the first pointer and the second pointer; and carrying out four times of unidirectional circular linked list traversing on the first pointer and the second pointer, and according to the XOR result of character bits to which the first pointer and the second pointer are pointed, obtaining a cryptograph file. According to the invention, the decryption scheme and the encryption method are consistent. The double-bit unidirectional circular linked list encryption and decryption method has the advantages that decoding is extremely difficult, the realization is easy, and the secrecy system is safer. The encryption method is characterized by disordered encryption, and transmission can be carried out on existing and public communication channels; no auxiliary hardware equipment is needed, and safety is realized by software; in addition, the secret key bytes can be of any length, and with the increasing of the length of the secret key bytes, the encryption complexity is also increased.
Description
Technical field
The present invention relates to dibit one-way circulation chained list encrypting and decrypting method based on stream cipher, belong to digital communication technology and
Field of information encryption.
Background technology
After the event of Snowdon, various countries all increase R&D intensity to the information security of oneself.Why the U.S. can obtain
Take the information content of other country, mainly have the following aspects problem.
The first, there are the technical advantage of communication technology, and power user's administrative power of the Internet in the U.S.;
The second, mail server (relevant departments of the U.S. force mail server service provider to provide e-mail messages), process route
The information (relevant departments of the U.S. force telecommunications services division and telecommunications equipment provider to provide information acquisition function) of device, mobile phone
The information of communication etc. all can be intercepted and captured by other people;
3rd, a lot of information transmits the plain code information being not encrypt in the Internet.This just obtains information to other people and obtains conveniently
(such as: the U.S. lives Afghanistan's Chief Commanding Officer's love letter mail and divulges a secret case);
4th, the U.S. puts into huge material resources, manpower, financial resources.Organize huge Network Information Gathering, process, analyze, screen,
The team processed.Collect various countries' information (such as: German Chancellor's Merkel's mobile communication information is ravesdropping event).
Stream cipher (stream cipher).Also referred to as stream cipher.The research state of existing stream cipher, owing to stream is close
Analysis and the design of code are often used for national military affairs and diplomatic correspondence.So, the research and development of stream cipher and design are substantially
Being all to carry out when secrecy, the every country research and development scholar of stream cipher and expert are in order to maintain secrecy almost without too much this
The disclosed treatise of aspect.Each state, all by stream cipher technique and product, limits outlet as war products.Owing to it has perhaps
The advantage that other passwords many are incomparable, so, it is one of the most general cryptographic system.
The research direction of present stream cipher, is all to use the algebraic operation of complexity, boolean based on mathematical model
Algebraic operation, pseudo random number, shift register, linear feedback etc..Complete encryption and the deciphering of stream cipher.Compare in this respect
The method of merit has A5 method, S cassette method, RC4 method, K2 method etc..These methods have been covert secrets, through for many years
Research, to its encryption and deciphering be provided with certain ripe means.The most existing a lot of scholar's research are attacked and are decoded
The ciphertext of said method encryption.This allows for the ciphertext using above method to be encrypted, and its safety is chosen greatly
War.
The at present design of stream cipher, the main method using systematology, the generation of key stream sequence mainly by
Linear feedback shift register produces pseudo-random sequence.The method generating pseudo-random number sequence has: feedback shift register sequence;Line
Property shift register add nonlinear feedforward function produce feedforward sequence, clock controlled sequence, combinational network sequence, carry shift LD
Device, cellular automata, chaology etc..
This method is for the deficiencies in the prior art, and technical scheme scheme uses chaotic flow (this chaotic flow
Generation, chaotic flow different from the past, technical scheme propose chaotic flow can be arbitrary file mode, and
It not the chaotic flow produced by function or signal generator, it is possible to this chaotic flow is called true random sequence rather than pseudorandom sequence
Row) the most parasitic method, even if this method is guessed, owing to chaotic flow is a unordered sequence, so, want to decode, almost
Can not realize.With the method for exhaustion, the most hardly possible realization, the most hardly possible realization.Exhaustive
Number of times is the secondary power of byte number (N) 8 times in plain text, it may be assumed that 28n。
Cited literature 2:
[1] what gram brilliant RC4 stream cipher and Microsoft's Office document security analysis [j]. computer engineering 2009.12 35
(23) p130-p135
[2] the research Xian Electronics Science and Technology University master thesis 2005.01 of Algebraic Attacks in Chen Jie stream cipher
[3] Design of Chaotic Stream Cipher [j] computer engineering that in kingization, Zhang Guixiang Shao Yong maps based on Logistic
2007.5 33(10) p164-p168
[4] Luo Songjiang Zhu Luping stream cipher encrypting based on piecewise nonlinear chaotic maps scheme [j] computer utility 30
(11) p3038-p3043
[5] Luo Weihua Algebraic Attacks based on stream cipher and Algebraic Immune Journal of Sex Research National University of Defense technology master thesis
2006.11
[6] Zhou Jiantao studies Southeast China University's master's degree based on the space-time definitiveness stochastic flow password synchronized and key exchange
Paper 2005.3
[7] Zhao Lijie stream cipher based on linear feedback shift register research and design large Southwest Jiaotong University scholar learn
Degree thesis whole-length 2006.4
[8] the research Xian Electronics Science and Technology University master thesis of Li Yuan stream cipher arithmetic based on word Dragon
2008.1
[9] Li Shunbo gives the distinguishing attack Harbin Engineering University journal of Pu Wang Yan stream cipher Sosemanuk recklessly
2012.2 33(2) p259-p262
[10] Fast Correlation Attack of Liu Qiong stream cipher studies Xian Electronics Science and Technology University's master thesis 2010.1
[11] king builds the design and analysis Beijing University of Technology Engineering Master academic dissertation 2006.6 of free flow password
[12] refined of Luo Qi builds present situation and development [j] information and electronic engineering 2006.2 4(1 of stream cipher) p75-p80
[13] Zhu Li gorgeous stream cipher complexity research Yangzhou University master thesis 2008.5
[14] bodyguard Wei people stream cipher and analysis of complexity Xian Electronics Science and Technology University Ph.D. Dissertation 2001.1 thereof
[15] the class evolution of Hu Nengfa stream cipher key sequence generates Central China University of Science and Technology's master thesis 2005.4
[16] Huang melts the research of Chaotic Encryption transmission stream cipher and realizes South China Science & Engineering University's master thesis
2005.5
[17] design of Dong Bin brightness Zhou Jianyong one chaos stream cipher algorithm and realization [j] computer engineering and application 2009,
45(35) p120-p150
[18] a kind of multidimensional chaotic stream cipher design [j] railway society 2003.12 based on parameter switching of Cai Ying Zhang Jiashu
25(6) p61-p65
[19] the beautiful distinguishing attack spending a kind of novel stream cipher structure of coroner is studied, Xian Electronics Science and Technology University's master's degree opinion
Literary composition 2008
[20] Li Shunbo recklessly gives Pu Wang Yan for distinguishing attack [j] electronics of stream cipher HC-256 ' and information journal
2012.4 34(4) p807-p811
[21] Liu Shukai closes the diligent conjecture decision attack computer engineering 2011.4 for stream cipher K2 algorithm of Jie Changya
37(7) p168-p170
[22] Chang Yaqin gold occasion brightness is for the known plain text attack computer engineering 2010.10 36 of stream cipher MAG algorithm
(20) p159-p172.
Summary of the invention
For the deficiencies in the prior art, we's technical scheme method use chaotic flow (this chaotic flow
Producing, chaotic flow different from the past, the chaotic flow that technical scheme proposes can be arbitrary file mode, and not
It is the chaotic flow produced by function or signal generator, it is possible to this chaotic flow is called true random sequence rather than pseudo-random sequence)
The most parasitic method, even if this method is guessed, owing to chaotic flow is a unordered sequence, so, want to decode, hardly may be used
Can realize.With the method for exhaustion, the most hardly possible realization, the most hardly possible realization.Exhaustive number of times
Secondary power for byte number (N) 8 times in plain text, it may be assumed that 28n。
Technical scheme includes dibit one-way circulation chained list encrypting and decrypting method based on stream cipher, and its feature exists
In, the method includes: S1, opens up memory headroom, prepares for clear text file, cryptograph files, key file and algorithm routine set
Corresponding memory space, wherein, key file is encryption and the shared file of deciphering, carries out above-mentioned set initially further
Change and set preset value is configured;S2, is respectively created the bright of correspondence to described clear text file, cryptograph files and key file
Literary composition encrypted random number, ciphertext encrypted random number and key encrypted random number, generate corresponding first according to the value of encrypted random number
Pointer and the second pointer;S3, runs the algorithm routine of described algorithm routine set to clear text file, cryptograph files, key file
Carry out the first pointer and the second pointer displacement reads;S4, carries out four one-way circulation chained lists time to the first pointer and the second pointer
Go through, simultaneously according to the XOR result of the character bit pointed by the first pointer and the second pointer, clear text file carried out successive ignition,
Obtain cryptograph files.
Further, wherein step S1 also includes: initialize clear text file, loads the clear text file needing encryption, arranges close
Key file he number, wherein the byte length of key file can carry out self-defined setting, further, key file he number
It is not more than clear text file he number, and then also includes that the self-defined algorithm transferred in algorithm routine set is adjusted as default place
Method, the corresponding retrieving algorithm of the most each encryption or decryption algorithms.
Further, wherein step S1 also includes: described clear text file, cryptograph files, key file are one-way circulation chain
Table storage mode byte symbol collection, this byte symbol collection for 0,1}, i.e. when the reading of one-way circulation chained list reception pointer, automatically
The pointer that will be located in table tail jumps to gauge outfit automatically;
Further, wherein step S2 also includes: S201, and the he number obtaining clear text file is n, chooses the integer less than n-1
As plaintext character random number;S202, the clear text file he number n obtained according to step S202, obtain the code of key file
Unit's number m, wherein m is not more than n, arranges ciphertext encrypted random number, chooses the integer less than n-1 as key character random number;
S203, chooses the integer less than n-1 as ciphertext character random number;S204, storage character random number in plain text, key character are random
Number and ciphertext character random number.
Further, wherein step S4 also includes: S401, and pointer and second plaintext pointer are respectively directed to bright in plain text to create first
Literary composition code element, creates the first key indicator and the second key indicator, creates the first ciphertext pointer and the second ciphertext pointer, also includes really
Distinguish literary composition, key, displacement law between corresponding first pointer of ciphertext and the second pointer;S402, is to the first key indicator
Two key indicator carry out four searching loops, when searching loop, the first key indicator and the second key indicator are carried out XOR and sentence
Fixed;S403, is carried out the first key indicator and the second key indicator according to displacement law according to step S402 XOR result of determination
Corresponding calculating, and result of calculation is write the first ciphertext pointer and the second ciphertext pointer;S404, writes result by step S403
The first ciphertext pointer and the character data of the second ciphertext pointer write, and generate cryptograph files.
Further, wherein step S402 also includes: S4021, performs the first step to the first key indicator and the second word key
Pointer carries out one-way circulation chained list traversal, when the XOR carrying out the first key indicator and the second key indicator judges, it is determined that knot
Fruit meets preset value and then according to displacement law, plaintext pointer and ciphertext pointer is carried out displacement, if do not meet preset value with; only
Plaintext pointer is carried out displacement, further when the second key indicator is empty, pointer address is reset;S4022, based on step
Rapid S4021, performs two, three, four one-way circulation chained list traversals, according to XOR decision condition during each one-way circulation chained list
Different, it is determined that result meets preset value and then according to displacement law, plaintext pointer and ciphertext pointer carried out displacement, if do not met
Preset value with the most only plaintext pointer is carried out displacement, further when the second key indicator be sky, pointer address is reset.
Technical scheme also realizes decryption method, and the method also includes: S5, transfers described from algorithm routine set
The retrieving algorithm that algorithm set by step S1 is corresponding, transfers clear text file, cryptograph files, encryption that key file is corresponding random
Number, and, need the cryptograph files being decrypted;S6, according to the length of clear text file, opens up ciphertext character array, described calculation
Method program creation functional interface, for obtaining character pointer in plain text according to encrypted random number, this plaintext character pointer is used for pointing to
Clear text file memory space;S7, runs the retrieving algorithm program of described algorithm routine set to clear text file, cryptograph files, close
Key file carries out the first pointer and the second pointer displacement reads;S8, carries out four times to the first key indicator and the second key indicator
Secondary circular linked list travels through, simultaneously according to the XOR result of the character bit pointed by the first key indicator and the second key indicator, time
Clear text file is generated after going through cryptograph files.
Further, described step S8 also includes: S801, creates the first ciphertext pointer and the second ciphertext pointer is respectively directed to bright
Literary composition code element, creates the first key indicator and the second key indicator, creates the first ciphertext pointer and the second ciphertext pointer, also includes really
Distinguish literary composition, key, displacement law between corresponding first pointer of ciphertext and the second pointer;S802, to the first key indicator and
Two key indicator carry out four searching loops, when searching loop, the first key indicator and the second key indicator are carried out XOR and sentence
Fixed;S803, is carried out the first key indicator and the second key indicator according to displacement law according to step S802 XOR result of determination
Corresponding calculating, and by result of calculation write first pointer and second plaintext pointer in plain text;S804, writes result by step S803
The character data of the first in plain text pointer and second plaintext pointer write, and generate clear text file.
Further, described step S802 also includes: S8021, performs the first step to the first key indicator and the second word key
Pointer carries out one-way circulation chained list traversal, when the XOR carrying out the first key indicator and the second key indicator judges, it is determined that knot
Fruit meets preset value and then according to displacement law, plaintext pointer and ciphertext pointer is carried out displacement, if do not meet preset value with; only
Plaintext pointer is carried out displacement, further when the second key indicator is empty, pointer address is reset;S8022, based on step
Rapid S801, performs two, three, four one-way circulation chained list traversals, according to XOR decision condition during each one-way circulation chained list
Different, it is determined that result meets preset value and then according to displacement law, ciphertext pointer and name literary composition pointer carried out displacement, if do not met
Preset value with the most only ciphertext pointer is carried out displacement, further when the second key indicator be sky, pointer address is reset,
Until completing four one-way circulation chained list traversals, complete deciphering.
The invention have the benefit that method is simple, decode extremely difficult;Use computerized algorithm and programming, it is achieved easily;Bright
Literary composition is encrypted, sends, is accepted, and three separation principles are carried out in deciphering so that secrecy system is safer;This encryption method is not traditional
One to one, one-to-many;But unordered encryption;Can be transmitted in communication channel existing, disclosed;Need not any auxiliary
Hardware device;Realize with software completely;Key byte can be random length, along with the increase of key byte length, and its encryption
Complexity is consequently increased.
Accompanying drawing explanation
Fig. 1 show the encrypting and decrypting schematic diagram according to embodiment of the present invention;
Fig. 2 a show the black list figure according to embodiment of the present invention;
Fig. 2 b show the encryption traversing graph according to embodiment of the present invention;
Fig. 3 show the decryption table figure according to embodiment of the present invention.
Detailed description of the invention
In order to make the object, technical solutions and advantages of the present invention clearer, below in conjunction with the accompanying drawings with specific embodiment pair
The present invention is described in detail.The interface Behavior-Based control system of the present invention is applicable to single-play game, mobile phone games, webpage trip
The exploitation of the game such as play, is particularly suited for the process of the interface behavior realized in control role plays the part of class game.
Fig. 1 show the encrypting and decrypting schematic diagram according to embodiment of the present invention.This figure performance public keys achieves bright
The phase co-conversion of literary composition ciphertext, wherein algorithm is the algorithm and the retrieving algorithm of correspondence encrypted or decipher.Based on this figure, encryption system
Four-tuple (M(plain code), C(ciphertext), P(key) and, A(algorithm
)).M, C, P, set A has the property that
1. { the byte symbol collection that 0,1} is made up of binary element of the information in set.It is suitable for ASCII character.
2. plain code set M has n byte, and its he number is denoted as: sum (M)=8n, has sum (M) mod 8=0;
3. the element number of ciphertext set C is to gather M as initial value, obtains c through r iteration1, c2, c3..., cr.For
cj(j=1,2,3 ..., r) subset he number is denoted as: sum (cj), there is sum (cj) mod 8=0;Assume cjByte number be
M, then have:
(1) as m < n, compression encryption.
(2) work as m=n, referred to as encrypt one to one, or referred to as isodensity encryption.
(3) m is worked as > n, referred to as redundancy encryption.
4. the he number of key set P.It is denoted as: sum (P), there is sum (P) mod 8=0;Assume byte in P set
Number is m, has m≤n.Byte number in preliminary definition P set is 1 byte.Key set P is shared in encryption, deciphering.In this set not
Containing 0xff, 0x00,0Xaa, 0x55 code.
5. the algorithm in this definition has, and feasibility, certainty, finiteness, has and uniquely inputs, has unique output.
6. algorithm set A is by the executable code collection of computer.The also referred to as set of function.Element in set A
Number is denoted as sum (A), has sum (A) mod 2=0.
Algorithm set characteristic: if there is algorithm a so that ciIt is encrypted to cj, then algorithm b must be there is so that cjIt is reduced into ci。
I.e. there is algorithm for inversion.Or retrieving algorithm.
Fig. 2 a show the black list figure according to embodiment of the present invention, and, encryption traversing graph shown in Fig. 2 b.Its step
Shown in rapid following 1-14:
1. plain code M={ China }={ 0xD6 0xD0 0xB9 0xFA}=(1,101 0,110 1,101 0,000 1,011 1,000 1111
1010)2。
2. key P={ Flos Rosae Rugosae }={ 0xC3 0xB5 0xB9 0xE5}=(1,100 0,011 1,011 0,101 1,011 1000
1110 0101)2。
3. open up and the cryptogram space of plain code equal length.Password C={0x00 0x00 0x00 0x00}.
5. take i=5, j=4, k=0.
6. fetching pin p1, p2。p1Point to X and gather x5Position, p2Point to X and gather x6Position.
7. fetching pin q1, q2。q1Point to P and gather y4Position, q2Point to P and gather y5Position.
8. fetching pin r1, r2。r1Point to C machine and z0Position, r2Point to C and gather z1Position.
9. do 4 circulations.
10. circulation for the first time, it is judged that (* q1==0)&&(q2==0) value, for " 1 ".Then: * r1=*p1,*r2=*p2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5。
11. second time circulations, it is judged that (* q1==0)&&(q2==1) value, for " 1 ".Then: * r1=*p1,*r2=*p2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5。
12. third time circulations, it is judged that (* q1==1)&&(q2==0) value, for " 1 ".Then: * r1=*p1,*r2=*p2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5。
13. the 4th circulations, it is judged that (* q1==1)&&(q2==1) value, for " 1 ".Then: * r1=*p1,*r2=*p2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, terminates.
14. obtain ciphertext, C={ M }={ 0xD8 0x56 0x4D 0xBE}=(1,101 1,000 0,101 0,110 0100
1101 1011 1110)2。
It show the decryption table figure according to embodiment of the present invention with reference to Fig. 3, and, the encryption traversing graph shown in Fig. 2 b.
Shown in the following 1-13 of implementation step:
1. ciphertext C={ M }={ 0xD8 0x56 0x4D 0xBE}=(1,101 1,000 0,101 0,110 0,100 1,101 1011
1110)2。
2. key P={ Flos Rosae Rugosae }={ 0xC3 0xB5 0xB9 0xE5}=(1,100 0,011 1,011 0,101 1,011 1000
1110 0101)2。
3. open up the plain code space with ciphertext equal length.M={0x00 0x00 0x00 0x00}.
4. take i=5, j=4, k=0.
5. fetching pin p1, p2。p1Point to X and gather x5Position, p2Point to X and gather x6Position.
6. fetching pin q1, q2。q1Point to P and gather y4Position, q2Point to P and gather y5Position.
7. fetching pin r1, r2。r1Point to C machine and z0Position, r2Point to C and gather z1Position.
8. do 4 searching loops.
9. circulation for the first time, it is judged that (* q1==0)&&(q2==0) value, for " 1 ".Then: * p1=*r1,*p2=*r2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5;.
10. second time circulation, it is judged that (* q1==0)&&(q2==1) value, for " 1 ".Then: * p1=*r1,*p2=*r2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5;.
11. third time circulations, it is judged that (* q1==1)&&(q2==0) value, for " 1 ".Then: * p1=*r1,*p2=*r2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, resets p1→x5;p2→x6。q1→y4;q2→y5;.
12. the 4th circulations, it is judged that (* q1==1)&&(q2==1) value, for " 1 ".Then: * p1=*r1,*p2=*r2.Move and refer to
Pin: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=q1+1;r1=r2+ 1, r2=r1+1.Otherwise: p1=p2+ 1, p2=p1+1;q1=q2+ 1, q2=
q1+1.Work as p2→ NULL, terminates.
13. obtain in plain text, M={ China }={ 0xD6 0xD0 0xB9 0xFA}=(1,101 0,110 1,101 0,000 1011
1000 1111 1010)2。
The above, simply presently preferred embodiments of the present invention, the invention is not limited in above-mentioned embodiment, as long as
It reaches the technique effect of the present invention with identical means, all should belong to protection scope of the present invention.Protection model in the present invention
In enclosing, its technical scheme and/or embodiment can have various different modifications and variations.
Claims (9)
1. dibit one-way circulation chained list encrypting and decrypting method based on stream cipher, it is characterised in that the method includes:
S1, opens up memory headroom, prepares corresponding storage for clear text file, cryptograph files, key file and algorithm routine set
Space, wherein, key file is encryption and the shared file of deciphering, initializes and above-mentioned file to set further
Preset value is configured;
S2, is respectively created the plain text encryption random number of correspondence, ciphertext encryption to described clear text file, cryptograph files and key file
Random number and key encrypted random number, generate the first corresponding pointer and the second pointer according to the value of encrypted random number;
S3, the algorithm routine running described algorithm routine set carries out the first pointer to clear text file, cryptograph files, key file
Read with the second pointer displacement;
S4, carries out four one-way circulation chained list traversals, refers to according to the first pointer and second simultaneously the first pointer and the second pointer
The XOR result of the character bit pointed by pin, carries out successive ignition to clear text file, obtains cryptograph files.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1, it is characterised in that
Wherein step S1 also includes:
Initialize clear text file, load the clear text file needing encryption, key file he number is set, wherein key file
Byte length can carry out self-defined setting, and further, key file he number is not more than clear text file he number, and then goes back
Including the self-defined algorithm transferred in algorithm routine set as default Processing Algorithm, the most each encryption or decryption algorithms is right
Answer retrieving algorithm.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1, it is characterised in that
Wherein step S1 also includes:
Described clear text file, cryptograph files, key file are the byte symbol collection of one-way circulation storage of linked list mode, and this byte accords with
Collection is for { 0,1}, i.e. when the reading of one-way circulation chained list reception pointer, the pointer that automatically will be located in table tail jumps to table automatically
Head.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1 and 2, its feature exists
In, wherein step S2 also includes:
S201, the he number obtaining clear text file is n, chooses the integer less than n-1 as plaintext character random number;
S202, the clear text file he number n obtained according to step S202, obtain the he number m of key file, and wherein m is not
More than n, ciphertext encrypted random number is set, chooses the integer less than n-1 as key character random number;
S203, chooses the integer less than n-1 as ciphertext character random number;
S204, storage character random number, key character random number and ciphertext character random number in plain text.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1, it is characterised in that
Wherein step S4 also includes:
S401, create first in plain text pointer and second plaintext pointer be respectively directed to code element in plain text, create the first key indicator and the
Two key indicator, create the first ciphertext pointer and the second ciphertext pointer, also include validating that plaintext, key, ciphertext corresponding first refers to
Displacement law between pin and the second pointer;
S402, is that the second key indicator carries out four searching loops, when searching loop to the first key to the first key indicator
Pointer and the second key indicator carry out XOR judgement;
S403, is carried out the first key indicator and the second key indicator according to displacement law according to step S402 XOR result of determination
Corresponding calculating, and result of calculation is write the first ciphertext pointer and the second ciphertext pointer;
S404, writes the first ciphertext pointer of step S403 write result and the character data of the second ciphertext pointer, and
Generate cryptograph files.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 5, it is characterised in that
Wherein step S402 also includes:
S4021, performs the first step and the first key indicator and the second word key indicator is carried out one-way circulation chained list traversal, carrying out
When the XOR of the first key indicator and the second key indicator judges, it is determined that result meets preset value and then plaintext pointer and ciphertext referred to
Pin carries out displacement according to displacement law, if do not meet preset value with; only plaintext pointer is carried out displacement, further when second
When key indicator is empty, pointer address is reset;
S4022, based on step S4021, performs two, three, four one-way circulation chained list traversals, during according to each one-way circulation chained list
The difference of XOR decision condition, it is determined that result meets preset value and then plaintext pointer and ciphertext pointer is carried out according to displacement law
Displacement, if do not meet preset value with; only plaintext pointer is carried out displacement, further when the second key indicator be sky, to finger
Pin address resets.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1, it is characterised in that
The method also includes:
S5, transfers, from algorithm routine set, the retrieving algorithm that the algorithm set by described step S1 is corresponding, transfers clear text file, close
Literary composition file, the encrypted random number that key file is corresponding, and, need the cryptograph files being decrypted;
S6, according to the length of clear text file, opens up ciphertext character array, and described algorithm routine creates functional interface, for basis
Encrypted random number obtains character pointer in plain text, and this plaintext character pointer is used for pointing to clear text file memory space;
S7, the retrieving algorithm program running described algorithm routine set carries out first to clear text file, cryptograph files, key file
Pointer and the second pointer displacement read;
S8, carries out four times circular linked list traversals, refers to according to the first key simultaneously the first key indicator and the second key indicator
The XOR result of the character bit pointed by pin and the second key indicator, generates clear text file after traversal cryptograph files.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 1, it is characterised in that
The method also includes:
S801, creates the first ciphertext pointer and the second ciphertext pointer is respectively directed to code element in plain text, creates the first key indicator and the
Two key indicator, create the first ciphertext pointer and the second ciphertext pointer, also include validating that plaintext, key, ciphertext corresponding first refers to
Displacement law between pin and the second pointer;
S802, carries out four searching loops to the first key indicator and the second key indicator, when searching loop to the first key
Pointer and the second key indicator carry out XOR judgement;
S803, is carried out the first key indicator and the second key indicator according to displacement law according to step S802 XOR result of determination
Corresponding calculating, and by result of calculation write first pointer and second plaintext pointer in plain text;
S804, writes the first plaintext pointer of step S803 write result and the character data of second plaintext pointer, and
Generate clear text file.
Dibit one-way circulation chained list encrypting and decrypting method based on stream cipher the most according to claim 7, it is characterised in that
Described step S8 also includes:
S8021, performs the first step and the first key indicator and the second word key indicator is carried out one-way circulation chained list traversal, carrying out
When the XOR of the first key indicator and the second key indicator judges, it is determined that result meets preset value and then plaintext pointer and ciphertext referred to
Pin carries out displacement according to displacement law, if do not meet preset value with; only plaintext pointer is carried out displacement, further when second
When key indicator is empty, pointer address is reset;
S8022, based on step S801, performs two, three, four one-way circulation chained list traversals, during according to each one-way circulation chained list
The difference of XOR decision condition, it is determined that result meets preset value and then ciphertext pointer and name literary composition pointer is carried out according to displacement law
Displacement, if do not meet preset value with; only ciphertext pointer is carried out displacement, further when the second key indicator be sky, to finger
Pin address resets, until completing four one-way circulation chained list traversals, completes deciphering.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610279725.8A CN105959118A (en) | 2016-04-28 | 2016-04-28 | Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610279725.8A CN105959118A (en) | 2016-04-28 | 2016-04-28 | Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105959118A true CN105959118A (en) | 2016-09-21 |
Family
ID=56916290
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610279725.8A Pending CN105959118A (en) | 2016-04-28 | 2016-04-28 | Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105959118A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106843962A (en) * | 2017-01-19 | 2017-06-13 | 北京乐盟互动科技有限公司 | One kind application packaging method and device |
CN108055126A (en) * | 2017-12-11 | 2018-05-18 | 哈尔滨理工大学 | The method of anti-power consumption attack based on random addition chain |
WO2018196634A1 (en) * | 2017-04-26 | 2018-11-01 | 吉林大学珠海学院 | Sequential encryption method based on multiple key stream passwords |
CN108777611A (en) * | 2018-05-11 | 2018-11-09 | 吉林大学 | Doubly linked list ordered encryption decryption method based on dual key stream cipher |
CN108777622A (en) * | 2018-05-11 | 2018-11-09 | 吉林大学 | A kind of binary stream hash modulus encrypting and decrypting method |
CN109194461A (en) * | 2018-05-11 | 2019-01-11 | 吉林大学 | Single-track link table ordered encryption decryption method based on dual key stream cipher |
CN109861820A (en) * | 2019-02-18 | 2019-06-07 | 吉林大学珠海学院 | Encrypting and decrypting method and device based on random hash and bit arithmetic |
CN109981249A (en) * | 2019-02-19 | 2019-07-05 | 吉林大学珠海学院 | Encrypting and decrypting method and device based on zip mode dynamic hashing and NLFSR |
CN109979116A (en) * | 2019-04-01 | 2019-07-05 | 深圳市摩线科技有限公司 | A kind of offline cryptogram encryption method about equipment leasing |
CN111177760A (en) * | 2019-12-30 | 2020-05-19 | 核工业北京地质研究院 | Data encryption and decryption method based on XOR algorithm improvement |
CN117134914A (en) * | 2023-10-26 | 2023-11-28 | 山东山大鸥玛软件股份有限公司 | One-time-pad random key stream encryption algorithm and system based on hardware characteristics |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012140144A1 (en) * | 2011-04-12 | 2012-10-18 | Telefonica, S.A. | Method and system for improving the synchronization of stream ciphers |
US20120284504A1 (en) * | 2011-05-02 | 2012-11-08 | Volkovs Nikolajs | Method and system for the Orange family of stream ciphers and method and system for generating stream ciphers based on the ERINDALE-PLUS hashing function |
CN102983972A (en) * | 2012-10-18 | 2013-03-20 | 郎六琪 | Dynamic encryption and decryption method based on stream cipher |
CN103095449A (en) * | 2013-01-16 | 2013-05-08 | 司玉娟 | Dynamic encryption and decryption method based on stream ciphers |
CN103595524A (en) * | 2013-10-21 | 2014-02-19 | 吉林大学 | Encryption and decryption method for bit loss encryption-bit filling decryption on basis of stream cipher |
CN105141413A (en) * | 2015-08-06 | 2015-12-09 | 吉林大学 | Circular linked list exclusive or encryption method and decryption method based on stream cipher |
-
2016
- 2016-04-28 CN CN201610279725.8A patent/CN105959118A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012140144A1 (en) * | 2011-04-12 | 2012-10-18 | Telefonica, S.A. | Method and system for improving the synchronization of stream ciphers |
US20120284504A1 (en) * | 2011-05-02 | 2012-11-08 | Volkovs Nikolajs | Method and system for the Orange family of stream ciphers and method and system for generating stream ciphers based on the ERINDALE-PLUS hashing function |
CN102983972A (en) * | 2012-10-18 | 2013-03-20 | 郎六琪 | Dynamic encryption and decryption method based on stream cipher |
CN103095449A (en) * | 2013-01-16 | 2013-05-08 | 司玉娟 | Dynamic encryption and decryption method based on stream ciphers |
CN103595524A (en) * | 2013-10-21 | 2014-02-19 | 吉林大学 | Encryption and decryption method for bit loss encryption-bit filling decryption on basis of stream cipher |
CN105141413A (en) * | 2015-08-06 | 2015-12-09 | 吉林大学 | Circular linked list exclusive or encryption method and decryption method based on stream cipher |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106843962A (en) * | 2017-01-19 | 2017-06-13 | 北京乐盟互动科技有限公司 | One kind application packaging method and device |
WO2018196634A1 (en) * | 2017-04-26 | 2018-11-01 | 吉林大学珠海学院 | Sequential encryption method based on multiple key stream passwords |
CN108055126A (en) * | 2017-12-11 | 2018-05-18 | 哈尔滨理工大学 | The method of anti-power consumption attack based on random addition chain |
WO2019214025A1 (en) * | 2018-05-11 | 2019-11-14 | 吉林大学珠海学院 | Sequential encryption and decryption method based on two-key stream cipher using doubly linked list |
US11082210B2 (en) | 2018-05-11 | 2021-08-03 | Zhuhai College Of Jilin University | Method for sequentially encrypting and decrypting singly linked lists based on double key stream ciphers |
CN109194461A (en) * | 2018-05-11 | 2019-01-11 | 吉林大学 | Single-track link table ordered encryption decryption method based on dual key stream cipher |
CN109194461B (en) * | 2018-05-11 | 2022-02-22 | 吉林大学 | Single-direction linked list sequence encryption and decryption method based on double-key stream cipher |
US11184154B2 (en) | 2018-05-11 | 2021-11-23 | Zhuhai College Of Jilin University | Method for sequentially encrypting and decrypting doubly linked lists based on double key stream ciphers |
CN108777622A (en) * | 2018-05-11 | 2018-11-09 | 吉林大学 | A kind of binary stream hash modulus encrypting and decrypting method |
WO2019214027A1 (en) * | 2018-05-11 | 2019-11-14 | 吉林大学珠海学院 | Sequential encryption and decryption method based on two-key stream cipher using singly linked list |
CN108777611A (en) * | 2018-05-11 | 2018-11-09 | 吉林大学 | Doubly linked list ordered encryption decryption method based on dual key stream cipher |
CN108777611B (en) * | 2018-05-11 | 2021-06-18 | 吉林大学 | Bidirectional linked list sequential encryption and decryption method based on double-key stream cipher |
CN108777622B (en) * | 2018-05-11 | 2021-03-26 | 吉林大学 | Binary stream hash modular encryption and decryption method |
CN109861820B (en) * | 2019-02-18 | 2021-05-25 | 吉林大学珠海学院 | Encryption and decryption method and device based on random hash and bit operation |
CN109861820A (en) * | 2019-02-18 | 2019-06-07 | 吉林大学珠海学院 | Encrypting and decrypting method and device based on random hash and bit arithmetic |
CN109981249A (en) * | 2019-02-19 | 2019-07-05 | 吉林大学珠海学院 | Encrypting and decrypting method and device based on zip mode dynamic hashing and NLFSR |
CN109979116B (en) * | 2019-04-01 | 2021-04-20 | 深圳市摩线科技有限公司 | Offline password encryption method for equipment leasing |
CN109979116A (en) * | 2019-04-01 | 2019-07-05 | 深圳市摩线科技有限公司 | A kind of offline cryptogram encryption method about equipment leasing |
CN111177760A (en) * | 2019-12-30 | 2020-05-19 | 核工业北京地质研究院 | Data encryption and decryption method based on XOR algorithm improvement |
CN117134914A (en) * | 2023-10-26 | 2023-11-28 | 山东山大鸥玛软件股份有限公司 | One-time-pad random key stream encryption algorithm and system based on hardware characteristics |
CN117134914B (en) * | 2023-10-26 | 2024-01-30 | 山东山大鸥玛软件股份有限公司 | One-time-pad random key stream encryption algorithm and system based on hardware characteristics |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105959118A (en) | Double-bit unidirectional circular linked list encryption and decryption method based on stream ciphers | |
CN106953875A (en) | Ordered encryption method based on multi-key cipher stream cipher | |
CN109861820A (en) | Encrypting and decrypting method and device based on random hash and bit arithmetic | |
US20100202606A1 (en) | Two strings private key (symmetric) encryption and decryption method | |
Omolara et al. | Developing a modified hybrid caesar cipher and vigenere cipher for secure data communication | |
CN105007256B (en) | Security module for executing security function on non-trusted platform | |
CN103095449B (en) | A kind of dynamic encryption decryption method based on stream cipher | |
CN109981249B (en) | Encryption and decryption method and device based on zipper type dynamic hash and NLFSR | |
CN109194461A (en) | Single-track link table ordered encryption decryption method based on dual key stream cipher | |
CN104378198A (en) | Voice encryption method based on block cipher system | |
Vyakaranal et al. | Performance analysis of symmetric key cryptographic algorithms | |
CN109951268A (en) | The encrypting and decrypting method and device with bit map are changed based on position | |
Mousavi et al. | Security of Internet of Things using RC4 and ECC algorithms (case study: smart irrigation systems) | |
CN111010266A (en) | Message encryption and decryption, reading and writing method and device, computer equipment and storage medium | |
Najm et al. | A New WoT Cryptography Algorithm Based on GOST and Novel 5d Chaotic System | |
Al-Shargabi et al. | A new DNA based encryption algorithm for internet of things | |
Dhiman et al. | Retracted: Blockchain‐based covert software information transmission for bitcoin | |
US20220417000A1 (en) | Random position cipher encryption using scrambled ascii strings | |
CN105141413B (en) | Circular linked list exclusive or encryption method and decryption method based on stream cipher | |
Wang et al. | Research and Implementation of Hybrid Encryption System Based on SM2 and SM4 Algorithm | |
CN108777611A (en) | Doubly linked list ordered encryption decryption method based on dual key stream cipher | |
Gong | [Retracted] Application Research of Data Encryption Algorithm in Computer Security Management | |
US10951399B2 (en) | Binary stream hash modulus encryption and decryption method | |
Aryan et al. | Cloud Cryptography: A Cutting-Edge Method to Protect Your Cloud | |
CN116527236B (en) | Information change verification method and system for encryption card |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160921 |
|
RJ01 | Rejection of invention patent application after publication |