WO2019214025A1 - 基于双密钥流密码的双向链表顺序加密解密方法 - Google Patents
基于双密钥流密码的双向链表顺序加密解密方法 Download PDFInfo
- Publication number
- WO2019214025A1 WO2019214025A1 PCT/CN2018/093661 CN2018093661W WO2019214025A1 WO 2019214025 A1 WO2019214025 A1 WO 2019214025A1 CN 2018093661 W CN2018093661 W CN 2018093661W WO 2019214025 A1 WO2019214025 A1 WO 2019214025A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pointer
- encryption
- key
- bit
- establishing
- Prior art date
Links
Images
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/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
-
- 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/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
-
- 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/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES 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/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
Definitions
- the invention relates to a two-way linked list sequential encryption and decryption method based on double key stream cipher, and belongs to the field of information security.
- Network communication information encryption aerospace digital remote control command and data encryption, drone digital remote control communication data encryption, early warning aircraft digital communication command system information encryption, GPS satellite digital communication data encryption, mobile communication encryption, email encryption, electronic financial data transmission encryption Wait.
- image coding images of various formats can be encrypted to protect image intellectual property. After encrypting military, political, and diplomatic documents, it can be transmitted by civil communication networks, saving file transfer costs.
- the United States has the technological advantages of communication technology and the superuser management rights of the Internet.
- the mail server (the relevant department in the United States forces the mail server service provider to provide mail information), the information through the router (the relevant departments of the United States force the communication service department and the communication equipment supplier to provide information interception function), the information of the mobile communication, etc. Can be intercepted by others.
- Stream cipher also known as sequence cipher.
- sequence cipher The current state of research on stream ciphers, because of the analysis and design of stream ciphers, is often used for military and diplomatic communications in a country. Therefore, the development and design of stream ciphers are basically carried out in a state of confidentiality.
- Scholars and experts who develop stream ciphers in various countries have almost no open disclosures on this aspect for confidentiality.
- countries have adopted streaming cryptography and products as military products to limit exports. Because it has many advantages over other passwords, it is one of the most versatile cryptosystems available today.
- the design scheme of stream cipher mainly adopts the system theory method, and the generation of the key stream sequence mainly uses the linear feedback shift register to generate a pseudo-random sequence.
- the method of generating the pseudo random number sequence is as follows: feedback shift register sequence; linear shift register plus nonlinear feedforward function to generate feedforward sequence; clock control sequence; combined network sequence; input bit register; cellular automaton; chaos theory, etc. .
- the technical solution of the present invention provides a two-way linked list sequential encryption and decryption method based on the dual key stream cipher according to the present invention.
- the chaotic stream is used. Different from the chaotic stream in the past, the chaotic stream proposed by the present invention can be an arbitrary file mode, rather than a chaotic stream generated by a function or a signal generator, and the chaotic stream can also be called a true random sequence. Rather than the dynamic parasitic method of pseudo-random sequences, even if this method is guessed, since the chaotic stream is an unordered sequence, it is almost impossible to decipher. With the exhaustive method, it is almost impossible to achieve in mathematics. The number of exhaustive times is the second power of 8 times the number of bytes in plaintext (N), that is, 2 8n , which is almost impossible to implement on a computer.
- the encryption uses the key set P and the algorithm set A, wherein the shared key set P and the algorithm set A are encrypted and decrypted, and the sets M and C are bidirectional circular linked lists, and the Chinese set M and The key set P corresponding to the pointer used for encryption is not a double number or a single number; the decryption includes retrieving the initial value of the iterative encryption, creating a pointer corresponding to the initial value, combining the C reference string and the encryption algorithm of the algorithm set A to the ciphertext set. C performs two decryptions to obtain a plaintext set M, and converts the plaintext set M into a plaintext file.
- the plaintext set M, the ciphertext set C, the key set P, and the algorithm set A are all character sets composed of binary symbols.
- the method further includes: encrypting the plaintext set M as an initial value and performing iterative encryption to obtain a ciphertext set C, including four failed encryption methods, Eight semi-encryption methods and four dual-key encryption methods, discarding all failed encryption methods and semi-encryption methods and performing four dual-key encryption methods, wherein four dual-key encryption methods include sequential encryption according to pointers of the circular linked list .
- the dual key encryption method further includes: a first encryption method, including a first encryption step and a second encryption step, wherein the first encryption step comprises: The pointer p1 is set to point to the x i0 bit of the plaintext set M, and when p1 is 0, p1 is set to 8n-1; the pointer p2 is pointed to the x i0 +1 bit of the plaintext set M, and when p2 is 8n-1, P2 is 0; the establishment pointer q points to the first key subset P 0 set y0 j0 bit; the establishment pointer r points to the first ciphertext subset C 0 set z0 k0 bit; sequentially performs encryption, including judging *q or!
- the second encryption step comprises: establishing a pointer p1 to point to the z0 i1 bit of the first ciphertext subset C 0 , and when p1 is 0, setting p1 to 8n-1; establishing a pointer p2 Pointing to the z0 i1 +1 bit of the second key subset P 1 , and setting p2 to 0 when p2 is 8n-1; establishing the pointer q to point to the y1 j1 bit of the second key subset P 1 ; establishing the pointer r Point to the z1 k1 bit of the second ciphertext subset C 1 ; perform encryption sequential
- the dual-key encryption method further includes: a second encryption method, including a first encryption step and a second encryption step, wherein the first encryption step comprises: The pointer p1 is set to point to the x i0 bit of the plaintext set M, and when p1 is 0, p1 is set to 8n-1; the pointer p2 is pointed to the x i0 +1 bit of the plaintext set M, and when p2 is 8n-1, P2 is 0; the establishment pointer q points to the first key subset P 0 set y0 j0 bit; the establishment pointer r points to the first ciphertext subset C 0 set z0 k0 bit; sequentially performs encryption, including judging *q or!
- the second encryption step comprises: establishing a pointer p1 pointing to the z0 i1 bit of the first ciphertext subset C 0 ; establishing a pointer p2 pointing to the y1 j1 bit of the second key subset P 1 ;
- the establishment pointer r1 points to the z0 k0 bit of the second key subset P 1 , and when r1 is 0, sets r1 to 8n-1;
- the establishment pointer r2 points to the z1 k1 bit of the first ciphertext subset C 0 , and when r2 When it is 8n-1, set r2 to 0; perform encryption
- the dual-key encryption method further includes: a third encryption method, including a first encryption step and a second encryption step, wherein the first encryption step comprises: Establishing a pointer p to point to the z0 i1 bit of the first ciphertext subset C 0 ; establishing a pointer q pointing to the y1 j1 bit of the second key subset P 1 ; establishing the pointer r1 pointing to the second ciphertext subset C 1 set z0 k0 bit, and when r1 is 0, r1 is set to 8n-1; r2 establishing a pointer pointing to a second subset of the ciphertext C 1 bit set z0 k0 +1, and when r2 is 8n-1, r2 is set to 0; execution order of encryption, comprising Judge *q or!
- the second encryption step comprises: establishing a pointer p1 to point to the z0 i1 bit of the first ciphertext subset C 1 , and when p1 is 0, setting p1 to 8n-1; establishing a pointer p2 Pointing to the z0 i1 +1 bit of the second key subset C 1 , and setting p2 to 0 when p2 is 8n-1; establishing the pointer q to point to the y0 j0 bit of the first key subset P 0 ; establishing the pointer r Point to the z1 k1 bit of the first ciphertext subset C 0 ; perform encryption sequentially
- the dual-key encryption method further includes: a fourth encryption method, including a first encryption step and a second encryption step, wherein the first encryption step comprises: The pointer p is set to point to the x i0 bit of the plaintext set M; the pointer q is pointed to the y0 j0 bit of the second key subset P 0 ; the pointer r1 is pointed to the second ciphertext subset C 0 set z0 k0 bit, and when r1 is 0 when r1 is set to 8n-1; r2 establishing a pointer pointing to a second subset of the ciphertext C 0 z0 k0 +1 bit set, and when r2 is 8n-1, r2 is set to 0; execution order of encryption, comprising determining or * q !
- the dual key stream cipher-based two-way linked list sequential encryption and decryption method which further includes a decryption method corresponding to the double key encryption method, which is characterized in that the initial values i 0 , i 1 , j for encryption are retrieved.
- the first decryption method comprises a first decryption step and a second decryption step, wherein the first decrypting step comprises: establishing a pointer p1 pointing to the z0 i1 bit of the first ciphertext subset C 0 , And when p1 is 0, set p1 to 8n-1; establish pointer p2 points to z0 i1 +1 bit of first ciphertext subset C 0 , and when p2 is 8n-1, set p2 to 0; establish pointer q pointing P 1 sets y1 j1 bits; establishes pointer r to point to C 1 set z1 k1 bit; performs decryption sequentially, including judging *q or!
- the second decrypting step comprises: establishing a pointer p1 to point to the x i0 bit of the plaintext set M, and when p1 is 0, setting p1 to 8n-1; establishing a pointer p2 pointing to the plaintext set M x i0 +1 bit, and when p2 is 8n-1, set p2 to 0; establish pointer q to point to first key subset P 0 set y0 j0 bit; establish pointer r to first ciphertext subset C 0 set Z0 k0 bit; perform encryption in sequence, including judging *q or!
- the dual key stream cipher-based two-way linked list sequential encryption and decryption method which includes a decryption method corresponding to the double key encryption method, which is characterized in that the initial values i 0 , i 1 , j 0 for decryption are retrieved.
- a second decryption method comprising a first decryption step and a second decryption step, wherein the first decrypting step comprises: establishing a pointer p1 pointing to the z0 i1 bit of the first ciphertext subset C 0 ; The pointer p2 points to the y1 j1 bit of the second key subset P 1 ; the establishment pointer r1 points to the z0 k0 bit of the second key subset P 1 , and when r1 is 0, sets r1 to 8n-1; establishes the pointer r2 Point to the z1 k1 bit of the first ciphertext subset C 0 , and when r2 is 8n-1, set r2 to 0; perform decryption sequentially, including judging *q or !
- the second decrypting step comprises: establishing a pointer p1 to point to the x i0 bit of the plaintext set M, and when p1 is 0, setting p1 to 8n-1; establishing the pointer p2 to point to the plaintext set x i0 +1 bit of M, and when p2 is 8n-1, set p2 to 0; establish pointer q to point to first key subset P 0 set y0 j0 bit; establish pointer r to first ciphertext subset C 0 Set z0 k0 bits; perform decryption in sequence, including judging *q or!
- the decryption method corresponding to the dual-key decryption method is characterized in that the initial values i 0 , i 1 , j 0 for decryption are retrieved.
- third decryption method comprising a first step and a second decryption step of decrypting, wherein the first decrypting step comprises: establishing a first pointer to point p1 subset z0 i1 ciphertext bits C 1, and When p1 is 0, p1 is set to 8n-1; the pointer p2 is pointed to the z0 i1 +1 bit of the second key subset C 1 , and when p2 is 8n-1, p2 is set to 0; the pointer q is established The y0 j0 bit of the first key subset P 0 ; the establishment pointer r points to the z1 k1 bit of the first ciphertext subset C 0 ; the decryption is performed sequentially, including judging *q or!
- the second decrypting step comprises: establishing a pointer p pointing to the z0 i1 bit of the first ciphertext subset C 0 ; establishing the pointer q pointing to the y1 j1 bit of the second key subset P 1 Establishing a pointer r1 pointing to the second ciphertext subset C 1 set z0 k0 bit, and when r1 is 0, setting r1 to 8n-1; establishing pointer r2 pointing to the second ciphertext subset C 1 set z0 k0 +1 bit, and When r2 is 8n-1, set r2 to
- the dual key stream cipher-based two-way linked list sequential encryption and decryption method which further includes a decryption method corresponding to the dual key decryption method, which is characterized in that the initial values i 0 , i 1 , j for decryption are retrieved.
- a fourth decryption method comprising a first decrypting step and a second decrypting step, wherein the first decrypting step comprises: establishing a pointer p pointing to the z0 i1 bit of the plaintext set C 0 ; establishing the pointer q Pointing to the y1 j1 bit of the second key subset P 1 ; establishing pointer r1 pointing to the second ciphertext subset C 1 set z1 k1 bit, and when r1 is 0, setting r1 to 8n-1; establishing pointer r2 pointing to the second The ciphertext subset C 1 sets z1 k1 +1 bits, and when r2 is 8n-1, r1 is set to 0; decryption is performed sequentially, including judging *q or!
- the second decrypting step comprises: establishing a pointer p to point to the x i0 bit of the plaintext set M; establishing a pointer q pointing to the y0 j0 bit of the second key subset P 0 ; establishing the pointer r1 Point to the second ciphertext subset C 0 set z0 k0 bit, and when r1 is 0, set r1 to 8n-1; establish pointer r2 points to the second ciphertext subset C 0 set z0 k0 +1 bit, and when r2 is 8n -1, set r2 to 0; perform decryption in sequence, including judging *q or !
- any analyzable file includes but is not limited to audio, video, picture, image, graphic, pseudo random code and chaotic value.
- the invention has the advantages that the method is simple and the deciphering is extremely difficult; the use of computer algorithms and programming is easy to implement; the three-separation principle of clear text decryption, transmission, acceptance, and decryption is implemented to make the security system more secure; the decryption method is not a traditional pair.
- One, one-to-many; but out-of-order decryption; can be transmitted on the existing, public communication channel; does not require any auxiliary hardware devices; completely implemented in software; the key byte can be any length, with the secret As the length of the key bytes increases, the decryption complexity also increases.
- Figure 1 shows a general flow chart in accordance with an embodiment of the present invention
- FIG. 2 is a detailed diagram of "p double r single” and “p double r single” encryption and decryption according to an embodiment of the present invention
- FIG. 3 is a detailed diagram of "p double r single” and "p single r double” encryption and decryption according to an embodiment of the present invention
- FIG. 5 is a detailed diagram of "p single r double” and “p single r double” encryption and decryption according to an embodiment of the present invention
- Figure 6 is a diagram showing an encrypted combination map in accordance with an embodiment of the present invention.
- the double key stream cipher based sequential decryption decryption method based on the double key stream cipher of the present invention is suitable for decryption and decryption.
- Figure 1 shows a general flow diagram in accordance with an embodiment of the present invention.
- the specific method includes: creating a plaintext set M according to the plaintext file, wherein the plaintext can be any analyzable file; the plaintext set M is used as an initial set and sequentially iteratively encrypted to obtain a ciphertext set C, wherein the iterative encryption is combined with the reference string and the secret
- the ciphertext set M is iteratively encrypted by the encryption algorithm of the pointer, the reference string, and the algorithm set A to obtain the ciphertext set C, and the Chinese set M and the key set P are correspondingly used for
- the encrypted pointers are not binary or singular at the same time;
- the ciphertext set C calls the key set P to perform multiple decryptions, wherein the encryption uses the key set P and the algorithm set A, wherein the encrypted and decrypted shared key set P and the algorithm set A, and the sets M and C are bidirectional circular linked lists, and the Chinese set M and the key set P corresponding to the pointer for encryption are not equal or singular;
- the decryption includes retrieving the initial value of the iterative encryption Initial binding creating pointers corresponding to encryption algorithm reference string and C Algorithm A set of ciphertext decrypts twice the set C, and expressly set M, and the set of plaintext M is converted to plaintext file.
- an encryption system quaternion (M, C, P, A)
- the M, C, P, A sets have the following characteristics:
- the information ⁇ 0, 1 ⁇ in the set is a set of byte symbols consisting of binary symbols, applicable to ASCII code;
- the number of elements of the ciphertext set C is that the M set is used as the initial value, and c 1 , c 21 , . . . , c j c1, c2, c3, . . . , cr are obtained after r iterations.
- the algorithm in algorithm set A has feasibility, accuracy, finiteness, unique input, and unique output.
- Algorithm set feature If there is an algorithm a, so that c i is encrypted into c j , then there must be an algorithm b, so that c j is reduced to c i , that is, there is an inverse algorithm or a reduction algorithm.
- n the number of inscription bytes.
- the set is an ordered set.
- the set is an ordered set.
- P 0 , P 1 sets are regarded as the cyclic linked list, P 0 has y0 8n-1 followed by y0 0 ; P 1 has y1 8n-1 followed by y1 0 ;
- the C 0 , C 1 set is regarded as a cyclical linked list, C 0 has z0 8n-1 followed by z0 0 ; C 1 has z1 8n-1 followed by z1 0 .
- This encryption method has a total of sixteen specific encryption methods, among them.
- the four encryptions are for failure encryption.
- the eight encryptions are semi-encrypted, equivalent to one key encryption, and discarded. There are only four encryption methods that can truly achieve double key encryption.
- FIG. 2 is a detailed diagram of "p double r single” and “p double r single” encryption and decryption according to an embodiment of the present invention.
- the value of q is "0"
- the value of p1 is placed in r
- the value of q is "1”
- the value of p2 is placed in r. details as follows:
- R 4 refers to the establishment of a set of points C 1 z1 k1 bits.
- the encrypted initial values i 0 , i 1 , j 0 , j 1 , k 0 , k 1 are retrieved.
- R 4 refers to the establishment of a set of points C 1 z1 k1 bits.
- FIG. 3 is a detailed diagram of "p double r single” and "p single r double” encryption and decryption according to an embodiment of the present invention.
- the value of q is “0", the value of p1 is taken, and r is placed.
- the value of q is “1” and takes the value of p2. Put r, q value is “0”, take p value into r1, q value is “1”, take p value into r2.
- FIG. 4 is a detailed diagram of "p single r double” and “p double r single” encryption and decryption according to an embodiment of the present invention.
- FIG. 5 is a detailed diagram of "p single r double” and “p single r double” encryption and decryption according to an embodiment of the present invention.
- this patented technology does not require dedicated computer hardware or dedicated electronic logic devices in the process of stream cipher encryption. No need for the design of logic circuits. Feedback problems and feedback algorithms that do not involve chaotic signals. It is completely computer software programming to solve the encryption and decryption process of stream ciphers. In this way, the external conditions for encryption and decryption of the plain code are very low. As long as there is a networked computer, encryption and decryption work can be performed. This technology has strong applicability.
- the software product developed by the technology can be applied to information transmission of the civil department, and can also be used for information transmission of the military department, and has good effects for remote control and image transmission encryption. Due to the difficulty of deciphering, it is almost impossible to decipher during the period of confidentiality.
- the above encryption process takes only one byte as a reference string. Such encryption is easy to crack. However, when the byte of the reference string is 8, 16, 32 or even 64 bytes, the difficulty of deciphering can be imagined.
- the length of the reference string can be the same as the length of the plaintext byte. Even if it is a single byte, it can be repeated multiple times. The difficulty of deciphering is also quite large.
- the method is encrypted with a double key, and the key can be placed in the hands of different people to ensure that the plaintext is more secure.
- Allocate key storage space p_str_P0 (char*)malloc(n*sizeof(char)).
- Allocate key storage space p_str_P1 (char*)malloc(n*sizeof(char)).
- the key file P0 is read into the space indicated by p_str_P0. Point to the first address of the space.
- the key file P1 is read into the space pointed to by p_str_P1.
- p_str_P1 points to the first address of the space.
- p_str_C0 points to the first address of the first encrypted ciphertext space.
- p_str_C1 points to the first encrypted ciphertext space first address.
- This function returns the value (0, 1) of the i-th bit of the string pointed to by p.
- This function writes the ith bit of the string pointed to by p to the value of j (0, 1).
- Figure 6 shows a cryptographic combination table in accordance with an embodiment of the present invention.
- the method includes: the encryption step of using the plaintext set M as an initial value and performing iterative encryption to obtain the ciphertext set C, including four failure encryption methods, eight semi-encryption methods, and four double key encryption methods, discarding all failure encryption methods and half
- the encryption method performs four kinds of double key encryption methods, and the four dual key encryption methods include sequential encryption according to the pointer of the circular linked list.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
本发明的技术方案包括基于双密钥流密码的双向链表顺序解密解密方法,其特征在于,该方法包括:根据明文文件创建明文集合M;将明文集合M作为初值并进行迭代解密得到密文集合C,其中迭代解密使用密钥集合P和算法集合A;对密文集合C调用密钥集合P进行调用密钥集合P中密钥多次解密,其中解密使用密钥集合P和算法集合A;将得到的解密结果转换为明文文件。本发明的有益效果为:实施方式简单,节省人力物力;解密复杂,能够有效提升解密的难度或者难以被解密;可将传输在现在互联网中的文件变得安全;他人截获也无法破译,传输技术和环境仍使用现有的互联网平台,但传输的信息是加密信息。
Description
本发明涉及基于双密钥流密码的双向链表顺序加密解密方法,属于信息安全领域。
网络通信信息加密,航天数字遥控指令与数据加密,无人机数字遥控通信数据加密,预警机数字通信指挥系统信息加密,GPS卫星数字通信数据加密,手机通信加密,电子邮件加密,电子金融数据传输加密等。在影像编码方面,可对各种格式影像加密,保护影像知识产权。对于军事、政治、外交文件加密后,可利用民用通信网络传输,节省文件传送成本。
斯诺登事件之后,各国对自己的信息安全都加大了研发力度。美国之所以能够获取他国的信息内容,主要有以下几个方面问题。
第一、美国有通信技术的技术优势,以及互联网的超级用户管理权。
第二、邮件服务器(美国的相关部门迫使邮件服务器服务商提供邮件信息)、经过路由器的信息(美国的相关部门迫使通信服务部门和通信设备供应商提供信息截获功能),手机通信的信息等都可被他人截获。
第三、很多信息在互联网中传输是不加密的明码信息。这就给他人获取信息取得方便(例如:美国住阿富汗总指挥官情书邮件泄密案)。
第四、美国投入巨大的物力、人力、财力。组织庞大的网络信息收集、加工、分析、筛选、处理的团队。收集各国信息(例如:德国总理默克尔手机通信信息被窃听事件)。
流密码(stream cipher),也称之为序列密码。现有流密码的研究状态,由于流密码的分析和设计往往用于一个国家的军事和外交通信。所以,流密码的研发和设计基本上都是在保密的状态下进行,各个国家研发流密码的学者和专家为了保密几乎没有过多的这方面的公开的论著。各国都将流密码技术和产品,作为军工产品而限制出口。由于它具有许多其他密码不可比拟的优点,所以,它是当今最为通用的密码系统之一。
现在的流密码学的研究方向,都是以数学模型为基础,使用复杂的代数运算、布尔代数运算、伪随机数、移位寄存器、线性反馈等。完成流密码的加密和解密。在这方面比较成功的方法有A5方法,S盒方法,RC4方法,K2方法等。这些方法已经是不公开的秘密,经过多年的研究,对其加密和解密已经具有了一定的成熟手段。现在已有很多学者研究攻击和破译上述方法加密的密文。这就使得使用以上的方法进行加密的密文,其安全性受到极大的挑战。
目前流密码的设计方案,主要采用系统论的方法,密钥流序列的生成主要是利用线性反馈移位寄存器产生伪随机序列。生成伪随机数列的方法如下:反馈移位寄存器序列;线性移位寄存器加非线性前馈函数产生前馈序列;钟控序列;组合网络序列;进位移位寄存器;元胞自动机;混沌理论等。
发明内容
针对现有技术的不足,本发明的技术方案提供了本发明基于双密钥流密码的双向链表顺序加密解密方法。采用的是混沌流,不同于以往的混沌流,本发明提出的混沌流可以是任意的文件模式,而不是由函数或信号发生器产生的混沌流,也可称本混沌流为真随机序列,而不是伪随机序列的动态寄生法,本方法即使被猜到,由于混沌流是一个无序的序列,所以,要想破译,几乎不可能实现。用穷举法,在数学上几乎不可能实现,穷举的次数为明文的字节数(N)8倍的二次幂,即:2
8n,在计算机上也几乎不可能实现。
本发明的技术方案包括基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法包括:根据明文文件创建明文集合M,其中明文可以是任意是任意可解析文件;将明文集合M作为初始集合并进行顺序迭代加密得到密文集合C,其中迭代加密结合使用参照串、密钥集合P及算法集合A,所述参照串为2
m字节,其中m>=0 且m为正整数;所述迭代加密包括获取文集合M、密文集合C、密钥集合P任意值作为初值以及初值对应的指针,通过指针、参照串及算法集合A的加密算法对文集合M进行两次迭代加密,得到密文集合C,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;对密文集合C调用密钥集合P进行多次解密,其中加密使用密钥集合P和算法集合A,其中加密和解密共享密钥集合P和算法集合A,且集合M、C均为双向循环链表,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;所述解密包括取回迭代加密的初值,创建初值对应的指针结合C参照串及算法集合A的加密算法对密文集合C进行两次解密,得到明文集合M,并将明文集合M转换为明文文件。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中明文集合M、密文集合C、密钥集合P及算法集合A均为二进制码元组成的字符集。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中根据明文文件创建明文集合M包括:读取明文文件,得到明文文件字节数n;创建明文集合M为为有序集,其中M={x
0x
1Λx
8n-1},x
i={0,1},并且有i(0<=i<=8n-1),M作为双向循环链表则有x
n-1的后继是x
0。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中该方法还包括:所述密钥集合P包括第一密钥子集和第二密钥子集,所述第一密钥P
0={y0
0y0
1Λy0
8n-1},y0
j0={0,1},其中j0(0<=j0<=8n-1),且P
0为有序集合,所述第二密钥子集P
1={y1
0y1
1Λy1
8n-1},y1
j1={0,1},其中j1(0<=j1<=8n-1),且P
1为有序集合,第一密钥子集P
0和第二密钥子集作为双向循环链表,对于P
0则有y0
8n-1的后继是y0
0,对于P
1则有y1
8n-1的后继是y1
0。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中该方法还包括:所述密文集合C包括第一密文子集和第二密文子集,所述第一密文子集C
0={z0
0z0
1Λz0
8n-1},y0
k0={0,1},其中k0(0<=k0<=8n-1),且C
0为有序集合,所述第二密钥子集C
1={z1
0z1
1Λz1
8n-1},z1
k1={0,1},其中k1(0<=k1<=8n-1),且C
1为有序集合,第一密钥C
0和第二密钥作为双向循环链表,对于C
0则有z0
8n-1的后继是z0
0,对于C
1则有z1
8n-1的后继是z1
0。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中该方法还包括:取任意初值i
0(0<=i
0<=8n-1),作为M集合的初值,并保留该初值;取任意初值i
1(0<=i
1<=8n-1),作为C
0集合的初值,并保留该初值;取任意初值j
0(0<=j
0<=8n-1),作为P
0集合的初值,并保留该初值;取任意初值j
1(0<=j
1<=8n-1),作为P
1集合的初值,并保留该初值;取任意初值k
0(0<=k
0<=8n-1),作为C
0集合的初值,并保留该初值;取任意初值k
1(0<=k
1<=8n-1),作为C
1集合的初值,并保留该初值。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中该方法还包括:将明文集合M作为初值并进行迭代加密得到密文集合C的加密步骤包括四种失败加密方法、八种半加密方法及四种双密钥加密方法,舍弃所有失败加密方法和半加密方法并执行四种双密钥加密方法,其中四种双密钥加密方法包括根据循环链表的指针进行顺序加密。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中双密钥加密方法还包括:第一加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p1指向明文集合M的x
i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x
i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0集合y0
j0位;建立指针r指向第一密文子集C
0集合z0
k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数;其中第二加密步骤包括:建立指针p1指向第一密文子集C
0的z0
i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集P
1的z0
i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第二密钥子集P
1的y1
j1位;建立指针r指向第二密文子集C
1的z1
k1位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p1和p2 为双数,其中r为单数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中双密钥加密方法还包括:第二加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p1指向明文集合M的x
i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x
i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0集合y0
j0位;建立指针r指向第一密文子集C
0集合z0
k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数;其中第二加密步骤包括:建立指针p1指向第一密文子集C
0的z0
i1位;建立指针p2指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密钥子集P
1的z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第一密文子集C
0的z1
k1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r2=*p且p、q及r2递增,若不为真则*r1=*p且p及q递增,r1递减,其中第二加密步骤的p为单数,其中r1和r2为双数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中双密钥加密方法还包括:第三加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p指向第一密文子集C
0的z0
i1位;建立指针q指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密文子集C
1集合z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
1集合z0
k0+1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p为单数,其中r1和r2为双数;其中第二加密步骤包括:建立指针p1指向第一密文子集C
1的z0
i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集C
1的z0
i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0的y0
j0位;建立指针r指向第第一密文子集C
0的z1
k1位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p1和p2为双数,其中r为单数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中双密钥加密方法还包括:第四加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p指向明文集合M的x
i0位;建立指针q指向第二密钥子集P
0的y0
j0位;建立指针r1指向第二密文子集C
0集合z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
0集合z0
k0+1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p为单数,其中r1和r2为双数;其中第二加密步骤包括:建立指针p指向明文集合C
0的z0
i1位;建立指针q指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密文子集C
1集合z1
k1位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
1集合z1
k1+1位,且当r2为8n-1时,置r1为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p为单数,其中r1和r2为双数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中还包括双密钥加密方法对应的解密方法,其特征在于:取回用于加密的初值i
0、i
1、j
0、j
1、k
0及k
1;第一解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C
0的z0
i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第一密文子集C
0的z0
i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向P
1集合y1
j1位;建立指针r指向C
1集合z1
k1位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p1和p2为双数,其中r为单数;其中第二解密步骤包括:建立指针p1指向明文集合M的x
i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x
i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0集合y0
j0位;建立指针r指向第一密文子集C
0集合z0
k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1 且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中包括双密钥加密方法对应的解密方法,其特征在于:取回用于解密的初值i
0、i
1、j
0、j
1、k
0及k
1;第二解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C
0的z0
i1位;建立指针p2指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密钥子集P
1的z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第一密文子集C
0的z1
k1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r2=*p且p、q及r2递增,若不为真则*r1=*p且p及q递增,r1递减,其中第二解密步骤的p为单数,其中r1和r2为双数;其中第二解密步骤包括:建立指针p1指向明文集合M的x
i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x
i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0集合y0
j0位;建立指针r指向第一密文子集C
0集合z0
k0位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p1和p2为双数,其中r为单数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中包括双密钥解密方法对应的解密方法,其特征在于:取回用于解密的初值i
0、i
1、j
0、j
1、k
0及k
1;第三解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C
1的z0
i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集C
1的z0
i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P
0的y0
j0位;建立指针r指向第第一密文子集C
0的z1
k1位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二解密步骤的p1和p2为双数,其中r为单数;其中第二解密步骤包括:建立指针p指向第一密文子集C
0的z0
i1位;建立指针q指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密文子集C
1集合z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
1集合z0
k0+1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p为单数,其中r1和r2为双数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中还包括双密钥解密方法对应的解密方法,其特征在于:取回用于解密的初值i
0、i
1、j
0、j
1、k
0及k
1;第四解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p指向明文集合C
0的z0
i1位;建立指针q指向第二密钥子集P
1的y1
j1位;建立指针r1指向第二密文子集C
1集合z1
k1位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
1集合z1
k1+1位,且当r2为8n-1时,置r1为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二解密步骤的p为单数,其中r1和r2为双数;其中第二解密步骤包括:建立指针p指向明文集合M的x
i0位;建立指针q指向第二密钥子集P
0的y0
j0位;建立指针r1指向第二密文子集C
0集合z0
k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C
0集合z0
k0+1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p为单数,其中r1和r2为双数。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中算法集合A包括至少一对用于加密的算法及对应的解密算法,且对于算法集合A,中的元素个数记作sum(A),具有sum(A)mod 2=0。
根据所述的基于双密钥流密码的双向链表顺序加密解密方法,其中任意可解析文件包括但不限于音频、视频、图片、图像、图形、伪随机码及混沌值。
本发明的有益效果为:方法简单,破译极难;使用计算机算法与编程,实现容易;明文解密、发送、接受,解密实行三分离原则,使得保密系统更加安全;本解密方法不是传统的一对一,一对多;而是无序解密;可在现有的、公开的通信信道进行传输;不需要任何的辅助硬件设备;完全用软件实现;密钥字节可以是任意长度,随着密钥字节长度的增加,其解密复杂度也随之增加。
图1所示为根据本发明实施方式的总体流程图;
图2所示为根据本发明实施方式的“p双r单”和“p双r单”加密解密详解图;
图3所示为根据本发明实施方式的“p双r单”和“p单r双”加密解密详解图;
图4所示为根据本发明实施方式的“p单r双”和“p双r单”加密解密详解图;
图5所示为根据本发明实施方式的“p单r双”和“p单r双”加密解密详解图;
图6所示为根据本发明实施方式的加密组合图。
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描述。本发明的基于双密钥流密码的双向链表顺序解密解密方法适用于解密解密。
图1所示为根据本发明实施方式的总体流程图。其具体包括:根据明文文件创建明文集合M,其中明文可以是任意是任意可解析文件;将明文集合M作为初始集合并进行顺序迭代加密得到密文集合C,其中迭代加密结合使用参照串、密钥集合P及算法集合A,所述参照串为2
m字节,其中m>=0且m为正整数;所述迭代加密包括获取文集合M、密文集合C、密钥集合P任意值作为初值以及初值对应的指针,通过指针、参照串及算法集合A的加密算法对文集合M进行两次迭代加密,得到密文集合C,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;对密文集合C调用密钥集合P进行多次解密,其中加密使用密钥集合P和算法集合A,其中加密和解密共享密钥集合P和算法集合A,且集合M、C均为双向循环链表,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;所述解密包括取回迭代加密的初值,创建初值对应的指针结合C参照串及算法集合A的加密算法对密文集合C进行两次解密,得到明文集合M,并将明文集合M转换为明文文件。
在本方法中,要想达到破译,必须要具备4个条件,1、算法程序;2、密文文件(一密一钥);3、秘钥文件1(也可称为秘钥);4、秘钥文件2(也可称为秘钥);但是,同时获得4个文件是不可能事件。其具体包括定义,加密及解密。
本发明的技术方案还公开了以下技术特征:加密体制四元组(M,C,P,A),且M,C,P,A集合具有如下特性:
集合内的信息{0,1}是由二进制码元组成的字节符集,适用ASCII码;
明文集合M具有n个字节,其码元个数记作:sum(M)=8n,具有sum(M)mod 8=0;
密文集合C的元素个数是将M集合作为初值,经过r次迭代得到c
1,c
21,....,c
jc1,c2,c3,…,cr。对于c
j(j=1,2,3,…,r)子集码元个数记作:sum(c
j),具有sum(c
j)mod 8=0;假设c
j的字节数为m,则有:
当m<n,压缩加密;
当m=n,称之为一对一加密,或称之为等密度加密;
当m>n,称之为冗余加密。
秘钥集合P的码元个数,记作:sum(P),具有sum(P)mod 8=0;假设P集合内字节数为m,有m≤n。初步定义P集合内的字节数为1字节,加密、解密共享秘钥集合P,该集合中不含有码0x00,0xff;
算法集合A中的算法具有,可行性、确切性、有穷性、有唯一输入、有唯一输出;
算法集合A是由计算机可执行的代码集合也称为函数的集合,集合A中的元素个数记作sum(A),具有sum(A)mod2=0;
算法集合特性:若存在算法a,使得c
i加密成c
j,则必存在算法b,使得c
j还原成c
i,即存在逆算法或还原算法。
(2)加密
1.设明文集合
M={x
0x
1…x
8n-1},x
i={0,1},并有i(0≤i≤8n-1),该集合为有序集。n代表铭文字节数。
2.设秘钥集合
P
0={y0
0y0
1…y0
8n-1},y0
j0={0,1},并有j0(0≤j0≤8n-1),该集合为有序集。
P
1={y1
0y1
1…y1
8n-1},y1
j1={0,1},并有j1(0≤j1≤8n-1),该集合为有序集。
3.设密文集合
C
0={z0
0z0
1…z0
8n-1},z0
k0={0,1},并有k0(0≤k0≤8n-1),该集合为有序集。
C
1={z1
0z1
1…z1
8n-1},z1
k1={0,1},并有k1(0≤k1≤8n-1),该集合为有序集。
4.将M集合视为循环链表,既有x
n-1的后继是x
0。
5.将P
0,P
1集合视为循环链表,P
0有y0
8n-1的后继是y0
0;P
1有y1
8n-1的后继是y1
0;
6.将C
0,C
1集合视为循环链表,C
0有z0
8n-1的后继是z0
0;C
1有z1
8n-1的后继是z1
0。
7.取任意初值i
0(0≤i
0≤8n-1),作用于M集合的初值,并保留该值。
取任意初值i
1(0≤i
1≤8n-1),作用于C
0集合的初值,并保留该值。
取任意初值j
0(0≤j
0≤8n-1),作用于P
0集合的初值,并保留该值。
取任意初值j
1(0≤j
1≤8n-1),作用于P
1集合的初值,并保留该值。
取任意初值k
0(0≤k
0≤8n-1),作用于C
0集合的初值,并保留该值。
取任意初值k
1(0≤k
1≤8n-1),作用于C
1集合的初值,并保留该值。
本加密方法共有16种具体的加密方法,其中。4种加密为失败加密。
8.head=0,tail=8*n-1。
9.本加密方法共有十六种具体的加密方法,其中。四种加密为失败加密。八种加密为半加密,等同与一个密钥加密,舍弃。真正能够达到双密钥加密仅有四种加密方法。
图2所示为根据本发明实施方式的“p双r单”和“p双r单”加密解密详解图。q的值为“0”时,取p1值放入r;q的值为“1”时,取p2值放入r。具体如下:
第一轮加密(p双r单)
1.建立指针p1指向M集合x
i0位。当p1->head,置p1->tail。
2.建立指针p2指向M集合x
i0+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z0
k0位。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
第二轮加密(p双r单)
1.建立指针p1指向C
0集合z0
i1位。当p1->head,置p1->tail。
2.建立指针p2指向C
0集合z0
i1+1位。当p2->tail,置p1->head。
3.建立指针q指向P
1集合y1
j1位。
4.建立指r指向C
1集合z1
k1位。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--。
解密方法1(p双r单p双r单)
取回加密初值i
0,i
1,j
0,j
1,k
0,k
1。
第一轮解密(p双r单)
1.建立指针p1指向C
0集合z0
i1位。当p1->head,置p1->tail。
2.建立指针p2指向C
0集合z0
i1+1位。当p2->tail,置p1->head。
3.建立指针q指向P
1集合y1
j1位。
4.建立指r指向C
1集合z1
k1位。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
第二轮解密(p双r单)
1.建立指针p1指向M集合x
i0位。当p1->head,置p1->tail。
2.建立指针p2指向M集合x
i0+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z0
k0位。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--。
图3所示为根据本发明实施方式的“p双r单”和“p单r双”加密解密详解图。q的值为“0”,取p1值,放入r。q的值为“1”,取p2值。放入r,q的值为“0”,取p值放入r1,q的值为“1”,取p值放入r2。
第一轮加密(p双r单)
1.建立指针p1指向M集合x
i0位。当p1->head,置p1->tail。
2.建立指针p2指向M集合x
i0+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z0
k0位。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
第二轮加密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z1
k1位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z1
k1+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*r2=*p;p++;q++;r2++;否则:*r1=*p;p++;q++;r1--;
6.也可,判断!(*q)为真,则:*r2=*p;p++;q++;r2++;否则:*r1=*p;p++;q++;r1--。
解密方法2(p双r单p单r双)
第一轮解密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z1
k1位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z1
k1+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*p=*r2;p++;q++;r2++;否则:*p=*r1;p++;q++;r1--;
6.也可,判断!(*q)为真,则:*p=*r2;p++;q++;r2++;否则:*p=*r1;p++;q++;r1--;
第二轮解密(p双r单)
1.建立指针p1指向M集合x
i0位。当p1->head,置p1->tail。
2.建立指针p2指向M集合x
i0+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z0
k0位。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;
r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--。
图4所示为根据本发明实施方式的“p单r双”和“p双r单”加密解密详解图。
第一轮加密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z0
k0位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z0
k0+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*r2=*p;p++;q++;r2++;否则:*r1=*p;p++;q++;r1--;
6.也可,判断!(*q)为真,则:*r2=*p;p++;q++;r2++;否则:*r1=*p;p++;q++;r1--;
第二轮加密(p双r单)
1.建立指针p1指向C
1集合z0
i1位。当p1->head,置p1->tail。
2.建立指针p2指向C
1集合z0
i1+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z1
k1位。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--。
解密方法3(p单r双p双r单)
第一轮解密(p双r单)
1.建立指针p1指向C
1集合z0
i1位。当p1->head,置p1->tail。
2.建立指针p2指向C
1集合z0
i1+1位。当p2->tail,置p1->head。
3.建立指针q指向P
0集合y0
j0位。
4.建立指针r指向C
0集合z1
k1位。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
第二轮解密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z0
k0位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z0
k0+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*p=*r2;p++;q++;r2++;否则:*p=*r1;p++;q++;r1--;
6.也可,判断!(*q)为真,则:*p=*r2;p++;q++;r2++;否则:*p=*r1;p++;q++;r1--。
图5所示为根据本发明实施方式的“p单r双”和“p单r双”加密解密详解图。
第一轮加密(p单r双)
1.建立指针p指向M集合x
i0位。
2.建立指针q指向P
0集合y0
j0位。
3.建立指针r1指向C
0集合z0
k0位。当r1->head,置r1->tail。
4.建立指针r2指向C
0集合z0
k0+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
第二轮加密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z1
k1位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z1
k1+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*r=*p2;p2++;q++;r++;否则:*r=*p1;q++;r++;p1--;
解密方法4(p单r双p单r双)
第一轮解密(p单r双)
1.建立指针p指向C
0集合z0
i1位。
2.建立指针q指向P
1集合y1
j1位。
3.建立指针r1指向C
1集合z1
k1位。当r1->head,置r1->tail。
4.建立指针r2指向C
1集合z1
k1+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
第二轮解密(p单r双)
1.建立指针p指向M集合x
i0位。
2.建立指针q指向P
0集合y0
j0位。
3.建立指针r1指向C
0集合z0
k0位。当r1->head,置r1->tail。
4.建立指针r2指向C
0集合z0
k0+1位。当r2->tail,置r1->head。
5.加密开始,判断*q为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--;
6.也可,判断!(*q)为真,则:*p2=*r;p2++;q++;r++;否则:*p1=*r;q++;r++;p1--。
此项专利技术与以往技术相比,在流密码加密的过程中不需要专用的计算机硬件、专用的电子逻辑器件。更不需要逻辑电路的设计。不涉及混沌信号的反馈问题和反馈算法。完全是用计算机软件编程解决流密码的加密和解密过程。这样,明码的加密和解密的外界条件要求很低。只要有联网的计算机,就可进行加密和解密工作。本项技术具有很强的适用性。
本加密技术中,协议文件(密钥)的内容越长,其解密的难度越大。现有技术规范为32字节。也可加大到64字节和128字节。甚至更长。
以本技术的开发的软件产品,可应用到外交部门的信息传输,也可用于军事部门的信息传输,对于遥控、图像传输加密也具有良好的效果。由于破译的难度高,在明码保密期间要想破译,几乎是不可能事件。
上述加密过程为只取一个字节作为参照串。这样的加密容易被破解。但是,当参照串的字节为8、16、32甚至64字节时,其破译的难度可想而知。而参照串的长度可以明文的字节长度一样。即使单字节,若能进行多次迭代。其破译难度也是相当的大。
由于现代通信技术的发展,增加一定量的传输代码,已经不是问题。
本方法是用双密钥加密,密钥可放在不同人手中,保证明文更加的安全。
参照图2-5所示为根据本发明实施方式的解密详解图。
说明:
1.M={“中国”}表示明文,即要加密的文本。{0xD6D0 0xB9FA}是“中国”两个汉字的机内码。为加密输入序列。
2.P0={“玫瑰”}表示一个密钥。{0xC3B5 0xB9E5}是“玫瑰”两个汉字的机内码。
3.P1={“牡丹”}表示另一密钥。{0xC4B5 0xB5A4}是“牡丹”两个汉字的机内码。
4.初值的选取i
0=5,i
1=3,j
0=4,j
1=6,k
0=2,k
1=1。
5.使用加密方法1,第一次加密获得密文C0={0x6E5B,0Xf934}。
6.使用加密方法1,第二次加密获得密文C1={0xa2f7,0x623f}。
解密过程
说明:
1.取回初值i
0=5,i
1=3,j
0=4,j
1=6,k
0=2,k
1=1。
2.C1={0xa2f7,0x623f}表示密文。
3.P1={“牡丹”}={0xC4B5 0xB5A4}是“牡丹”两个汉字的机内码。也是第二个密钥。
4.用P1密钥及解密方法1,得到C0={0x6E5B,0Xf934}这个第一次加密密文。
5.再使用P0={“玫瑰”}={0xC3B5 0xB9E5},将C0={0x6E5B,0Xf934}这个第一次加密密文还原到明文M={“中国”}={0xD6D0 0xB9FA}。
加密和解密算法
1.明文文件M={“中国”}={0xD6 0xD0 0xB9 0xFA}=(1101 0110 1101 0000 1011 1000 1111 1010)
2。
密钥文件P0={“玫瑰”}={0xC3 0xB5 0xB9 0xE5}=(1100 0011 1011 0101 1011 1000 1110 0101)
2。
密钥文件P1={“牡丹”}={0xC4 0xB5 0xB5 0xA4}=(1100 0100 1011 0101 1011 0101 1010 0100)
2。
2.建立字符指针char*p_str_M。
建立字符指针char*p_str_P0。
建立字符指针char*p_str_P1。
建立字符指针char*p_str_C0。
建立字符指针char*p_str_C1。
3.打开明文文件M,统计明文文件M的字节数,并存放到n中。
4.分配明文存储空间p_str_M=(char*)malloc(n*sizeof(char))。
分配密钥存储空间p_str_P0=(char*)malloc(n*sizeof(char))。
分配密钥存储空间p_str_P1=(char*)malloc(n*sizeof(char))。
分配密文存储空间p_str_C0=(char*)malloc(n*sizeof(char))。
分配密文存储空间p_str_C1=(char*)malloc(n*sizeof(char))。
5.将明文文件M读入到p_str_M所指空间。p_str_M指向该空间首地址。
将密钥文件P0读入到p_str_P0所指空间。指向该空间首地址。
将密钥文件P1读入到p_str_P1所指空间。p_str_P1指向该空间首地址。
p_str_C0指向第一次加密密文空间首地址。
p_str_C1指向第二次加密密文空间首地址。
6.取位初值i0=5,即从p_str_M所指空间的第x0
5位(bit)开始。并保留该值。参看图1。
取位初值i1=3,即从p_str_C0所指空间的第z0
3位(bit)开始。并保留该值。参看图1。
取位初值j0=4,即从p_str_P0所指空间的第y0
4位(bit)开始。并保留该值。参看图1。
取位初值j1=6,即从p_str_P1所指空间第y1
6位(bit)开始。并保留该值。参看图1。
取位初值k0=2,即从p_str_C0所指空间的第z0
2位(bit)开始。并保留该值。参看图1。
取位初值k1=1,即从p_str_C0所指空间的第z1
1位(bit)开始。并保留该值。参看图1。
7.建立一个函数
int string_read_bit(char*p,int i);
该函数返回p所指的字符串第i位(bit)的值(0,1)。
8.建立一个函数
void string_write_bit(char*p,int i,int j);
该函数将p所指的字符串第i位(bit),写入j的值(0,1)。
9.以加密方法1为例
第一次加密
建立变量p1,p2,p1=i0,p2=i0+1。
建立变量q,r,q=j0,r=k0。for(i=0;i<8*n;i++)
第二次加密
建立变量p1,p2,p1=i1,p2=i1+1。
建立变量q,r,q=j1,r=k1。
10.将p_str_C1指向分配的密文存储空间首地址,将该空间的n个字节写入到密文文件C中。
11.获得密文文件,C={“[謆”}={0x3bea 0xf56d}=(0011 1011 1110 1010 1111 0101 0110 1101)
2。
12.上述过程可靠参看图1所示。
解密过程
以加密方法1为例
第一次解密
建立变量p1,p2,p1=i1,p2=i1+1。
建立变量q,r,q=j1,r=k1。
第二次解密
建立变量p1,p2,p1=i0,p2=i0+1。
建立变量q,r,q=j0,r=k0。
应用函数源程序
图6所示为根据本发明实施方式的加密组合表。其包括:将明文集合M作为初值并进行迭代加密得到密文集合C的加密步骤包括四种失败加密方法、八种半加密方法及四种双密钥加密方法,舍弃所有失败加密方法和半加密方法并执行四种双密钥加密方法,其中四种双密钥加密方法包括根据循环链表的指针进行顺序加密。
此方法2次加密方式共有16种组合方式,2次加密全部成功的共有4种,2次加密全部失败的共有4种,2次加密仅有一次加密成功的共有8种,这8种对于二次加密没有任何意义,故舍弃,我们只申报2次加密全部成功的这4种方法,最后状态:"1"表示成功,"0"表示失败。
以上所述,只是本发明的较佳实施例而已,本发明并不局限于上述实施方式,只要其以相同的手段达到本发明的技术效果,都应属于本发明的保护范围。在本发明的保护范围内其技术方案和/或实施方式可以有各种不同的修改和变化。
Claims (17)
- 基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法包括根据明文文件创建明文集合M,其中明文可以是任意是任意可解析文件;将明文集合M作为初始集合并进行顺序迭代加密得到密文集合C,其中迭代加密结合使用参照串、密钥集合P及算法集合A,所述参照串为2 m字节,其中m>=0且m为正整数;所述迭代加密包括获取文集合M、密文集合C、密钥集合P任意值作为初值以及初值对应的指针,通过指针、参照串及算法集合A的加密算法对文集合M进行两次迭代加密,得到密文集合C,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;对密文集合C调用密钥集合P进行多次解密,其中加密使用密钥集合P和算法集合A,其中加密和解密共享密钥集合P和算法集合A,且集合M、C均为双向循环链表,其中文集合M及密钥集合P对应用于加密的指针不同时为双数或单数;所述解密包括取回迭代加密的初值,创建初值对应的指针结合C参照串及算法集合A的加密算法对密文集合C进行两次解密,得到明文集合M,并将明文集合M转换为明文文件。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述明文集合M、密文集合C、密钥集合P及算法集合A均为二进制码元组成的字符集。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述根据明文文件创建明文集合M包括:读取明文文件,得到明文文件字节数n;创建明文集合M为为有序集,其中M={x 0x 1Λx 8n-1},x i={0,1},并且有i(0<=i<=8n-1),M作为双向循环链表则有x n-1的后继是x 0。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法还包括:所述密钥集合P包括第一密钥子集和第二密钥子集,所述第一密钥P 0={y0 0y0 1Λy0 8n-1},y0 j0={0,1},其中j0(0<=j0<=8n-1),且P 0为有序集合,所述第二密钥子集P 1={y1 0y1 1Λy1 8n-1},y1 j1={0,1},其中j1(0<=j1<=8n-1),且P 1为有序集合,第一密钥子集P 0和第二密钥子集P 1作为单向循环链表,对于P 0则有y0 8n-1的后继是y0 0,对于P 1则有y1 8n-1的后继是y1 0。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法还包括:所述密文集合C包括第一密文子集和第二密文子集,所述第一密文子集C 0={z0 0z0 1Λz0 8n-1},y0 k0={0,1},其中k0(0<=k0<=8n-1),且C 0为有序集合,所述第二密钥子集C 1={z1 0z1 1Λz1 8n-1},z1 k1={0,1},其中k1(0<=k1<=8n-1),且C 1为有序集合,第一密钥C 0和第二密钥作为双向循环链表,对于C 0则有z0 8n-1的后继是z0 0,对于C 1则有z1 8n-1的后继是z1 0。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法还包括:将明文集合M作为初值并进行迭代加密得到密文集合C的加密步骤包括四种失败加密方法、八种半加密方法及四种双密钥加密方法,舍弃所有失败加密方法和半加密方法并执行四种双密钥加密方法,其中四种双密钥加密方法包括根据循环链表的指针进行顺序加密。
- 根据权利要求3-6任意所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,该方法还包括:取任意初值i 0(0<=i 0<=8n-1),作为M集合的初值,并保留该初值;取任意初值i 1(0<=i 1<=8n-1),作为C 0集合的初值,并保留该初值;取任意初值j 0(0<=j 0<=8n-1),作为P 0集合的初值,并保留该初值;取任意初值j 1(0<=j 1<=8n-1),作为P 1集合的初值,并保留该初值;取任意初值k 0(0<=k 0<=8n-1),作为C 0集合的初值,并保留该初值;取任意初值k 1(0<=k 1<=8n-1),作为C 1集合的初值,并保留该初值。
- 根据权利要求7所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述双密钥加密方法还包括:第一加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p1指向明文集合M的x i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0集合y0 j0位;建立指针r指向第一密文子集C 0集合z0 k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数;其中第二加密步骤包括:建立指针p1指向第一密文子集C 0的z0 i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集P 1的z0 i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第二密钥子集P 1的y1 j1位;建立指针r指向第二密文子集C 1的z1 k1位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p1和p2为双数,其中r为单数。
- 根据权利要求7所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述双密钥加密方法还包括:第二加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p1指向明文集合M的x i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0集合y0 j0位;建立指针r指向第一密文子集C 0集合z0 k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数;其中第二加密步骤包括:建立指针p1指向第一密文子集C 0的z0 i1位;建立指针p2指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密钥子集P 1的z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第一密文子集C 0的z1 k1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r2=*p且p、q及r2递增,若不为真则*r1=*p且p及q递增,r1递减,其中第二加密步骤的p为单数,其中r1和r2为双数。
- 根据权利要求7所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述双密钥加密方法还包括:第三加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p指向第一密文子集C 0的z0 i1位;建立指针q指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密文子集C 1集合z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 1集合z0 k0+1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p为单数,其中r1和r2为双数;其中第二加密步骤包括:建立指针p1指向第一密文子集C 1的z0 i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集C 1的z0 i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0的y0 j0位;建立指针r指向第第一密文子集C 0的z1 k1位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p1和p2为双数,其中r为单数。
- 根据权利要求7所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述双密钥加密方法还包括:第四加密方法,包括第一加密步骤和第二加密步骤,其中第一加密步骤包括:建立指针p指向明文集合M的x i0位;建立指针q指向第二密钥子集P 0的y0 j0位;建立指针r1指向第二密文子集C 0集合z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 0集合z0 k0+1位,且当r2为8n-1时,置r2为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p为单数,其中r1和r2为双数;其中第二加密步骤包括:建立指针p指向明文集合C 0的z0 i1位;建立指针q指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密文子集C 1集合z1 k1位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 1集合z1 k1+1位,且当r2为8n-1时,置r1为0;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二加密步骤的p为单数,其中r1和r2为双数。
- 根据权利要求8-11任意所述的基于双密钥流密码的双向链表顺序加密解密方法,还包括双密钥加密方法对应的解密方法,其特征在于:取回用于加密的初值i 0、i 1、j 0、j 1、k 0及k 1;第一解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C 0的z0 i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第一密文子集C 0的z0 i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向P 1集合y1 j1位;建立指针r指向C 1集合z1 k1位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1 且q及r递增,p1递减,其中第一解密步骤p1和p2为双数,其中r为单数;其中第二解密步骤包括:建立指针p1指向明文集合M的x i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0集合y0 j0位;建立指针r指向第一密文子集C 0集合z0 k0位;顺序执行加密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一加密步骤p1和p2为双数,其中r为单数。
- 根据权利要求8-11任意所述的基于双密钥流密码的双向链表顺序加密解密方法,还包括双密钥加密方法对应的解密方法,其特征在于:取回用于解密的初值i 0、i 1、j 0、j 1、k 0及k 1;第二解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C 0的z0 i1位;建立指针p2指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密钥子集P 1的z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第一密文子集C 0的z1 k1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r2=*p且p、q及r2递增,若不为真则*r1=*p且p及q递增,r1递减,其中第二解密步骤的p为单数,其中r1和r2为双数;其中第二解密步骤包括:建立指针p1指向明文集合M的x i0位,且当p1为0时,置p1为8n-1;建立指针p2指向明文集合M的x i0+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0集合y0 j0位;建立指针r指向第一密文子集C 0集合z0 k0位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p1和p2为双数,其中r为单数。
- 根据权利要求8-11任意所述的基于双密钥流密码的双向链表顺序解密解密方法,还包括双密钥解密方法对应的解密方法,其特征在于:取回用于解密的初值i 0、i 1、j 0、j 1、k 0及k 1;第三解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p1指向第一密文子集C 1的z0 i1位,且当p1为0时,置p1为8n-1;建立指针p2指向第二密钥子集C 1的z0 i1+1位,且当p2为8n-1时,置p2为0;建立指针q指向第一密钥子集P 0的y0 j0位;建立指针r指向第第一密文子集C 0的z1 k1位;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二解密步骤的p1和p2为双数,其中r为单数;其中第二解密步骤包括:建立指针p指向第一密文子集C 0的z0 i1位;建立指针q指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密文子集C 1集合z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 1集合z0 k0+1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p为单数,其中r1和r2为双数。
- 根据权利要求8-11任意所述的基于双密钥流密码的双向链表顺序解密解密方法,还包括双密钥解密方法对应的解密方法,其特征在于:取回用于解密的初值i 0、i 1、j 0、j 1、k 0及k 1;第四解密方法,包括第一解密步骤和第二解密步骤,其中第一解密步骤包括:建立指针p指向明文集合C 0的z0 i1位;建立指针q指向第二密钥子集P 1的y1 j1位;建立指针r1指向第二密文子集C 1集合z1 k1位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 1集合z1 k1+1位,且当r2为8n-1时,置r1为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p2且q及r递增,p1递减,其中第二解密步骤的p为单数,其中r1和r2为双数;其中第二解密步骤包括:建立指针p指向明文集合M的x i0位;建立指针q指向第二密钥子集P 0的y0 j0位;建立指针r1指向第二密文子集C 0集合z0 k0位,且当r1为0时,置r1为8n-1;建立指针r2指向第二密文子集C 0集合z0 k0+1位,且当r2为8n-1时,置r2为0;顺序执行解密,包括判断*q或!(*q)为真,若为真则*r=*p2且p2、q及r递增,若不为真则*r=*p1且q及r递增,p1递减,其中第一解密步骤p为单数,其中r1和r2为双数。
- 根据权利要求1所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,所述算法集合A包括至少一对用于加密的算法及对应的解密算法,且对于算法集合A,中的元素个数记作sum(A),具有sum(A)mod 2=0。
- 根据权利要求1-16任意所述的基于双密钥流密码的双向链表顺序加密解密方法,其特征在于,其中所述密钥集合P对应的密钥文件包括但不限于音频、视频、图片、图像、图形、伪随机码及混沌值。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/461,162 US11184154B2 (en) | 2018-05-11 | 2018-06-29 | Method for sequentially encrypting and decrypting doubly linked lists based on double key stream ciphers |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810449252.0 | 2018-05-11 | ||
CN201810449252.0A CN108777611B (zh) | 2018-05-11 | 2018-05-11 | 基于双密钥流密码的双向链表顺序加密解密方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019214025A1 true WO2019214025A1 (zh) | 2019-11-14 |
Family
ID=64027083
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/093661 WO2019214025A1 (zh) | 2018-05-11 | 2018-06-29 | 基于双密钥流密码的双向链表顺序加密解密方法 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11184154B2 (zh) |
CN (1) | CN108777611B (zh) |
WO (1) | WO2019214025A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108777611B (zh) | 2018-05-11 | 2021-06-18 | 吉林大学 | 基于双密钥流密码的双向链表顺序加密解密方法 |
CN109981249B (zh) * | 2019-02-19 | 2020-09-08 | 吉林大学珠海学院 | 基于拉链式动态散列和nlfsr的加密解密方法及装置 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040039908A1 (en) * | 2002-08-23 | 2004-02-26 | Rose Gregory G. | Partial encryption and full authentication of message blocks |
CN103595523A (zh) * | 2012-08-15 | 2014-02-19 | 希姆通信息技术(上海)有限公司 | 基于混沌变换的文件加解密方法及其系统 |
CN105959118A (zh) * | 2016-04-28 | 2016-09-21 | 吉林大学 | 基于流密码的双位单向循环链表加密解密方法 |
CN106953875A (zh) * | 2017-04-26 | 2017-07-14 | 吉林大学珠海学院 | 基于多密钥流密码的顺序加密方法 |
Family Cites Families (75)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5734823A (en) * | 1991-11-04 | 1998-03-31 | Microtome, Inc. | Systems and apparatus for electronic communication and storage of information |
US6633877B1 (en) * | 1991-11-04 | 2003-10-14 | Digeo, Inc. | Method and apparatus for delivery of selected electronic works and for controlling reproduction of the same |
US5365589A (en) * | 1992-02-07 | 1994-11-15 | Gutowitz Howard A | Method and apparatus for encryption, decryption and authentication using dynamical systems |
CA2128115C (en) * | 1993-07-20 | 1999-08-10 | Keiichi Iwamura | Encryption apparatus, communication system using the same and method therefor |
US5825878A (en) * | 1996-09-20 | 1998-10-20 | Vlsi Technology, Inc. | Secure memory management unit for microprocessor |
US6088449A (en) * | 1996-11-05 | 2000-07-11 | Tri-Strata Security, Inc. | Tri-signature security architecture systems and methods |
US6064738A (en) * | 1996-12-10 | 2000-05-16 | The Research Foundation Of State University Of New York | Method for encrypting and decrypting data using chaotic maps |
US6845159B1 (en) * | 1998-10-07 | 2005-01-18 | Protego Information Ab | Processing method and apparatus for converting information from a first format into a second format |
US20010031050A1 (en) * | 2000-02-14 | 2001-10-18 | Lateca Computer Inc. N.V. | Key generator |
AU2001269354A1 (en) * | 2000-05-12 | 2001-11-20 | Xtreamlok Pty. Ltd. | Information security method and system |
US7170997B2 (en) * | 2000-12-07 | 2007-01-30 | Cryptico A/S | Method of generating pseudo-random numbers in an electronic device, and a method of encrypting and decrypting electronic data |
US20020136400A1 (en) * | 2001-01-08 | 2002-09-26 | Arif Askerov | R-conversion encryption method and system |
US6898288B2 (en) * | 2001-10-22 | 2005-05-24 | Telesecura Corporation | Method and system for secure key exchange |
KR20040052254A (ko) * | 2001-10-26 | 2004-06-22 | 마츠시타 덴끼 산교 가부시키가이샤 | 디지털 저작물 보호시스템, 키관리장치 및 사용자장치 |
US8214655B2 (en) * | 2002-03-29 | 2012-07-03 | Kabushiki Kaisha Toshiba | Data structure of multimedia file format, encrypting method and device thereof, and decrypting method and device thereof |
US20040086117A1 (en) * | 2002-06-06 | 2004-05-06 | Petersen Mette Vesterager | Methods for improving unpredictability of output of pseudo-random number generators |
GB0214620D0 (en) * | 2002-06-25 | 2002-08-07 | Koninkl Philips Electronics Nv | Round key generation for AES rijndael block cipher |
NZ542765A (en) * | 2003-04-01 | 2007-12-21 | Mi Kyoung Park | Mobile communication terminal having a function of reading out information from contactless type communication tag and method for providing information of whether an article is genuine or not |
US20060072746A1 (en) * | 2004-09-28 | 2006-04-06 | Tadepalli Hari K | Register scheduling in iterative block encryption to reduce memory operations |
US8005209B2 (en) * | 2005-01-06 | 2011-08-23 | Polytechnic University | Invariance based concurrent error detection for the advanced encryption standard |
US7769168B2 (en) * | 2005-03-31 | 2010-08-03 | Microsoft Corporation | Locally interative encryption generating compliant ciphertext for general syntax specifications |
US7685430B1 (en) * | 2005-06-17 | 2010-03-23 | Sun Microsystems, Inc. | Initial password security accentuated by triple encryption and hashed cache table management on the hosted site's server |
JP2007013506A (ja) * | 2005-06-29 | 2007-01-18 | N-Crypt Inc | 暗号化処理装置、暗号化方法、復号化処理装置、復号化方法、及びデータ構造 |
US7549058B1 (en) * | 2005-06-30 | 2009-06-16 | Mavs Lab. Inc. | Method and apparatus for encrypting and decrypting digital data |
JP4482630B2 (ja) * | 2005-11-21 | 2010-06-16 | インターナショナル・ビジネス・マシーンズ・コーポレーション | 通信装置および通信方法 |
CA2531411C (en) * | 2005-12-23 | 2017-02-14 | Bce Inc | System and method for encrypting traffic on a network |
US8020006B2 (en) * | 2006-02-10 | 2011-09-13 | Cisco Technology, Inc. | Pipeline for high-throughput encrypt functions |
US20070280474A1 (en) * | 2006-04-18 | 2007-12-06 | Heinz Karl E | Encryption Method |
US8868930B2 (en) * | 2006-05-31 | 2014-10-21 | International Business Machines Corporation | Systems and methods for transformation of logical data objects for storage |
WO2007138601A2 (en) * | 2006-05-31 | 2007-12-06 | Storwize Ltd. | Method and system for transformation of logical data objects for storage |
US7889861B2 (en) * | 2006-09-13 | 2011-02-15 | Michael Borza | Multiple sequential security key encryption-decryption |
US8538012B2 (en) * | 2007-03-14 | 2013-09-17 | Intel Corporation | Performing AES encryption or decryption in multiple modes with a single instruction |
US20100023748A1 (en) * | 2007-12-28 | 2010-01-28 | Emulex Design & Manufacturing Corporation | Self checking encryption and decryption based on statistical sampling |
US8180055B2 (en) * | 2008-02-05 | 2012-05-15 | Harris Corporation | Cryptographic system incorporating a digitally generated chaotic numerical sequence |
US9336160B2 (en) * | 2008-10-30 | 2016-05-10 | Qualcomm Incorporated | Low latency block cipher |
JP2010185982A (ja) * | 2009-02-10 | 2010-08-26 | Toshiba Storage Device Corp | 暗号化装置、復号化装置及び記憶装置 |
WO2011013148A1 (en) * | 2009-07-28 | 2011-02-03 | Telecom Italia S.P.A. | Symmetric-key encryption method and cryptographic system employing the method |
US8942371B2 (en) * | 2009-09-03 | 2015-01-27 | Jerzy Henryk Urbanik | Method and system for a symmetric block cipher using a plurality of symmetric algorithms |
EP2293487A1 (en) * | 2009-09-08 | 2011-03-09 | Thomson Licensing | A method of diversification of a round function of an encryption algorithm |
JP5645725B2 (ja) * | 2010-04-28 | 2014-12-24 | キヤノン株式会社 | データ処理装置およびデータ処理システムおよびその制御方法 |
US9798898B2 (en) * | 2010-05-25 | 2017-10-24 | Via Technologies, Inc. | Microprocessor with secure execution mode and store key instructions |
US8611533B2 (en) * | 2011-05-02 | 2013-12-17 | Nikolajs VOLKOVS | 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 |
US8605894B2 (en) * | 2011-07-14 | 2013-12-10 | Apple Inc. | Cryptographic process execution protecting an input value against attacks |
US9008308B2 (en) * | 2012-02-08 | 2015-04-14 | Vixs Systems, Inc | Container agnostic decryption device and methods for use therewith |
WO2013144384A1 (es) * | 2012-03-27 | 2013-10-03 | Carrillo De La Fuente Miguel Angel | Métodos protección y sistema distribución de ficheros digitales de primera/segunda mano, alquiler, intercambio y cesión |
US9397830B2 (en) * | 2012-12-30 | 2016-07-19 | Raymond Richard Feliciano | Method and apparatus for encrypting and decrypting data |
US9698991B2 (en) * | 2013-03-15 | 2017-07-04 | Ologn Technologies Ag | Systems, methods and apparatuses for device attestation based on speed of computation |
WO2014145624A1 (en) * | 2013-03-15 | 2014-09-18 | General Instrument Corporation | Dlna/dtcp stream conversion for secure media playback |
US9143317B2 (en) * | 2013-05-24 | 2015-09-22 | Apple Inc. | Protecting against white box attacks using column rotation |
WO2015032063A1 (zh) * | 2013-09-06 | 2015-03-12 | 东莞市乐升电子有限公司 | 利用触屏装置实现系统加密保护的方法 |
US9178699B2 (en) * | 2013-11-06 | 2015-11-03 | Blackberry Limited | Public key encryption algorithms for hard lock file encryption |
US9513913B2 (en) * | 2014-07-22 | 2016-12-06 | Intel Corporation | SM4 acceleration processors, methods, systems, and instructions |
GB2528959C (en) * | 2014-08-07 | 2017-06-28 | Gurulogic Microsystems Oy | Encoder, decoder and methods |
SG10201405852QA (en) * | 2014-09-18 | 2016-04-28 | Huawei Internat Pte Ltd | Encryption function and decryption function generating method, encryption and decryption method and related apparatuses |
US10009169B2 (en) * | 2014-12-02 | 2018-06-26 | Zettaset, Inc. | Format-preserving cipher |
US9313023B1 (en) * | 2014-12-02 | 2016-04-12 | Zettaset, Inc. | Format-preserving cipher |
US9979537B2 (en) * | 2014-12-02 | 2018-05-22 | Zettaset, Inc. | Format-preserving cipher |
US10110373B2 (en) * | 2015-02-13 | 2018-10-23 | Global Integrity, Inc. | System and method for manipulating both the plaintext and ciphertext of an encryption process prior to dissemination to an intended recipient |
US10796782B2 (en) * | 2015-03-23 | 2020-10-06 | Private Access, Inc. | System, method and apparatus to enhance privacy and enable broad sharing of bioinformatic data |
US9692592B2 (en) * | 2015-06-05 | 2017-06-27 | Apple Inc. | Using state reordering to protect against white box attacks |
US10348704B2 (en) * | 2015-07-30 | 2019-07-09 | Helder Silvestre Paiva Figueira | Method for a dynamic perpetual encryption cryptosystem |
CN105141413B (zh) * | 2015-08-06 | 2018-05-15 | 吉林大学 | 基于流密码的循环链表异或加密方法及解密方法 |
KR101745706B1 (ko) * | 2015-12-18 | 2017-06-09 | 주식회사 케이티 | 생체 정보 기반 인증 장치 그리고 이의 동작 방법 |
EP3188063A1 (en) * | 2015-12-29 | 2017-07-05 | GuardSquare NV | A build system |
US10103873B2 (en) * | 2016-04-01 | 2018-10-16 | Intel Corporation | Power side-channel attack resistant advanced encryption standard accelerator processor |
US20170365191A1 (en) * | 2016-06-17 | 2017-12-21 | Lior Malka | Iterative encryption and random generation and serialization of cryptographic functions |
US10341102B2 (en) * | 2016-09-02 | 2019-07-02 | Blackberry Limited | Decrypting encrypted data on an electronic device |
US11005650B2 (en) * | 2016-10-19 | 2021-05-11 | Stripe, Inc. | Systems and methods for data management and the use of salts and keys in data encryption/decryption |
US10547460B2 (en) * | 2016-11-18 | 2020-01-28 | Qualcomm Incorporated | Message-based key generation using physical unclonable function (PUF) |
CN106788974B (zh) * | 2016-12-22 | 2020-04-28 | 深圳国微技术有限公司 | 掩码s盒、分组密钥计算单元、装置及对应的构造方法 |
US10965456B2 (en) * | 2017-09-25 | 2021-03-30 | The Boeing Company | Systems and methods for facilitating data encryption and decryption and erasing of associated information |
US10187200B1 (en) * | 2017-12-18 | 2019-01-22 | Secure Channels Inc. | System and method for generating a multi-stage key for use in cryptographic operations |
CN108777611B (zh) | 2018-05-11 | 2021-06-18 | 吉林大学 | 基于双密钥流密码的双向链表顺序加密解密方法 |
CN109194461B (zh) * | 2018-05-11 | 2022-02-22 | 吉林大学 | 基于双密钥流密码的单向链表顺序加密解密方法 |
US11616635B2 (en) * | 2019-11-27 | 2023-03-28 | Duality Technologies, Inc. | Recursive algorithms with delayed computations performed in a homomorphically encrypted space |
-
2018
- 2018-05-11 CN CN201810449252.0A patent/CN108777611B/zh active Active
- 2018-06-29 US US16/461,162 patent/US11184154B2/en active Active
- 2018-06-29 WO PCT/CN2018/093661 patent/WO2019214025A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040039908A1 (en) * | 2002-08-23 | 2004-02-26 | Rose Gregory G. | Partial encryption and full authentication of message blocks |
CN103595523A (zh) * | 2012-08-15 | 2014-02-19 | 希姆通信息技术(上海)有限公司 | 基于混沌变换的文件加解密方法及其系统 |
CN105959118A (zh) * | 2016-04-28 | 2016-09-21 | 吉林大学 | 基于流密码的双位单向循环链表加密解密方法 |
CN106953875A (zh) * | 2017-04-26 | 2017-07-14 | 吉林大学珠海学院 | 基于多密钥流密码的顺序加密方法 |
Also Published As
Publication number | Publication date |
---|---|
CN108777611B (zh) | 2021-06-18 |
US11184154B2 (en) | 2021-11-23 |
CN108777611A (zh) | 2018-11-09 |
US20200213080A1 (en) | 2020-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019214027A1 (zh) | 基于双密钥流密码的单向链表顺序加密解密方法 | |
WO2018196634A1 (zh) | 基于多密钥流密码的顺序加密方法 | |
CN111034115B (zh) | 用于扩展真随机数池的表观大小的加密系统和方法 | |
GB2551865A (en) | Improved stream cipher system | |
CN109981249B (zh) | 基于拉链式动态散列和nlfsr的加密解密方法及装置 | |
Thinn et al. | Modification of AES algorithm by using second key and modified subbytes operation for text encryption | |
Saikumar | DES-Data Encryption Standard | |
Yahaya et al. | Cryptosystem for secure data transmission using Advance Encryption Standard (AES) and Steganography | |
WO2019214025A1 (zh) | 基于双密钥流密码的双向链表顺序加密解密方法 | |
Ahmed et al. | Cryptography and State-of-the-art Techniques | |
Chaloop et al. | Enhancing Hybrid Security Approach Using AES And RSA Algorithms | |
WO2019214024A1 (zh) | 一种二进制流散列取模加密解密方法 | |
US20230082077A1 (en) | Cryptographic systems and methods for maintenance of pools of random numbers | |
Sharma et al. | Design and implementation of encryption algorithm for real time speech signals | |
Pamungkas et al. | Implementation Of The Base64 Algorithm For Text Encryption And Decryption Using The Python Programming Language | |
Abdelgader et al. | Design of a secure file transfer system using hybrid encryption techniques | |
Al-Kareem et al. | A review of the most effective cryptography techniques based on conventional block cipher and lightweight | |
CN111835506B (zh) | 基于一次使用密码本的信息安全数字加密方法 | |
US20230299940A1 (en) | Single stream one time pad with encryption with expanded entropy | |
An-Nissa et al. | RC4 GGHN Cryptography Algorithm for Message Security | |
Khalid et al. | Encrypting data using the features of memetic algorithm and cryptography | |
Al-Nemri et al. | New Block Cipher Encryption Based On OTP Algorithm | |
Yenagandula et al. | Hybrid Model for Multimedia Encryption | |
Onwughalu et al. | Enhancement of data security on transmission network using fuzzy logic | |
Abbas et al. | Audio cryptosystem based on LFSH and Chaotic map with ECC key management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18917594 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18917594 Country of ref document: EP Kind code of ref document: A1 |