Movatterモバイル変換


[0]ホーム

URL:


CN100589380C - An Encryption Method Based on Double Circular Queue Shift and Transposition Rules - Google Patents

An Encryption Method Based on Double Circular Queue Shift and Transposition Rules
Download PDF

Info

Publication number
CN100589380C
CN100589380CCN200810017494ACN200810017494ACN100589380CCN 100589380 CCN100589380 CCN 100589380CCN 200810017494 ACN200810017494 ACN 200810017494ACN 200810017494 ACN200810017494 ACN 200810017494ACN 100589380 CCN100589380 CCN 100589380C
Authority
CN
China
Prior art keywords
matrix
transformation matrix
computing
mod
key
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.)
Expired - Fee Related
Application number
CN200810017494A
Other languages
Chinese (zh)
Other versions
CN101237322A (en
Inventor
武苏里
景旭
张阳
谢小军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Northwest A&F University
Original Assignee
Northwest A&F University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Northwest A&F UniversityfiledCriticalNorthwest A&F University
Priority to CN200810017494ApriorityCriticalpatent/CN100589380C/en
Publication of CN101237322ApublicationCriticalpatent/CN101237322A/en
Application grantedgrantedCritical
Publication of CN100589380CpublicationCriticalpatent/CN100589380C/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

Abstract

Translated fromChinese

本发明涉及一种双循环队列移位和换位规则的加密方法,包括以下步骤:取明文信息矩阵;创建随机整数序列;用户输入矩阵变换次数;在随机整数序列中任取随机数并取整;根据设定的余数规则对变换矩阵的其中一行或一列进行循环队列移位并可换位;经多次变换后,得到密文矩阵;将各次变换操作过程记录为子密钥依次排列得到密钥。本发明属于古典置换加密,采用最基本的移位操作,利用较少的资源实现快速的加解密过程,解决了现有移位加密方法加密强度小、速度低、操作性差等问题,具有加解密速度快、加密方法实现简单、加密方法加密强度高、安全性好、适用面广的优点,适用于软、硬件实现。

Figure 200810017494

The present invention relates to an encryption method of double circular queue shift and transposition rules, comprising the following steps: taking a plaintext information matrix; creating a random integer sequence; a user inputting the number of matrix transformations; taking any random number in the random integer sequence and rounding it; performing circular queue shift and transposition on one row or column of the transformation matrix according to a set remainder rule; obtaining a ciphertext matrix after multiple transformations; recording each transformation operation process as a subkey and arranging them in sequence to obtain a key. The present invention belongs to classical permutation encryption, adopts the most basic shift operation, and uses fewer resources to achieve a fast encryption and decryption process, solving the problems of low encryption strength, low speed, and poor operability of existing shift encryption methods, and has the advantages of fast encryption and decryption speed, simple encryption method implementation, high encryption strength, good security, and wide applicability, and is suitable for software and hardware implementation.

Figure 200810017494

Description

Translated fromChinese
基于双循环队列移位和换位规则的加密方法An Encryption Method Based on Double Circular Queue Shift and Transposition Rules

技术领域technical field

本发明涉及一种传统加密方法,尤其涉及一种基于双循环队列移位规则和换位规则的传统加密方法。The present invention relates to a traditional encryption method, in particular to a traditional encryption method based on a double-cycle queue shift rule and a transposition rule.

背景技术Background technique

传统加密方法主要通过代换和置换两种方式实现信息的隐藏。典型的置换加密方法包括栅栏置换、转轮机等。其中置换方式不隐藏原明文的字符,采用将组成明文的字符重新排序以达到信息隐藏的目的。Traditional encryption methods mainly realize the hiding of information through substitution and permutation. Typical permutation encryption methods include fence permutation, rotary machine, etc. The replacement method does not hide the characters of the original plaintext, but reorders the characters that make up the plaintext to achieve the purpose of information hiding.

但是,现有的置换移位加密方法的加密强度小、对信息置乱度低,有些加密方法如转轮机等只适用于硬件实现。However, the existing permutation and shift encryption methods have low encryption strength and low degree of information scrambling, and some encryption methods such as rotary machines are only suitable for hardware implementation.

发明内容Contents of the invention

本发明目的是提出一种基于双循环队列移位和换位规则的加密方法,其解决了现有置换加密方法加密强度小、速度低、操作性差等问题,适用于软、硬件实现。The purpose of the present invention is to propose an encryption method based on double-cycle queue shift and transposition rules, which solves the problems of low encryption strength, low speed, and poor operability in existing replacement encryption methods, and is suitable for software and hardware implementation.

本发明的技术解决方案是:Technical solution of the present invention is:

一种基于双循环队列移位和换位规则的加密方法,具体步骤如下:A kind of encryption method based on the shift and transposition rules of double-circular queues, the specific steps are as follows:

步骤1]取m×n的明文信息矩阵A;Step 1] Take the plaintext information matrix A of m×n;

步骤2]创建随机整数序列X={r∈N,r≤max(m,n)};Step 2] Create a sequence of random integers X = {r ∈ N, r ≤ max(m, n)};

步骤3]用户根据加密强度要求,输入一个整数w作为矩阵变换次数;Step 3] The user inputs an integer w as the number of matrix transformations according to the encryption strength requirements;

步骤4]在随机整数序列X中任取随机数k,运算k=k mod 5;Step 4] Random number k is randomly selected in random integer sequence X, and operation k=k mod 5;

当k=0时,从随机整数序列X中取4个随机数L1、L2、L3、L4,要求L1<L3≤m,L2<L4≤n;然后以第L1行作为起始行、以第L3行作为结束行、以第L2列作为起始列、以第L4列作为结束列,构建变换矩阵A’,记录操作过程为#fL1/L2/L3/L4,形成一个子密钥;When k=0, take 4 random numbers L1 , L2 , L3 , L4 from the random integer sequence X, and require L1 <L3 ≤m, L2 <L4 ≤n; then use the Lth Row1 is used as the start row, rowL3 is the end row, columnL2 is the start column, columnL4 is the end column, and the transformation matrix A' is constructed, and the operation process is recorded as #fL1 /L2 /L3 /L4 , forming a subkey;

当k=1时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L3-L1)),运算y=1+(y mod(1+L3-L1)),运算z=z mod 2,对变换矩阵A’中的第x行和第y行进行循环左移位,当z=0时,不换位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,记录操作过程为#ax/y/z,形成一个子密钥;When k=1, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L3 -L1 )), and operate y=1+ (y mod(1+L3 -L1 )), operation z=z mod 2, perform circular left shift on row x and row y in transformation matrix A', when z=0, no transposition , when z=1, move out the two information exchange positions of the transformation matrix A' and put them into the transformation matrix A', and record the operation process as #ax/y/z to form a sub-key;

当k=2时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L4-L2)),运算y=1+(y mod(1+L4-L2)),运算z=z mod 2,对变换矩阵A’中的第x列和第y列进行循环下移位,当z=0时,不换位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,记录操作过程#bx/y/z,形成一个子密钥;When k=2, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L4 -L2 )), and operate y=1+ (y mod(1+L4 -L2 )), operate z=z mod 2, perform circular shift down on the xth column and yth column in the transformation matrix A', when z=0, no transposition , when z=1, remove the two information exchange positions of the transformation matrix A' and put them into the transformation matrix A', record the operation process #bx/y/z, and form a sub-key;

当k=3时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L3-L1),运算y=1+(y mod(1+L3-L1)),运算z=z mod 2,对变换矩阵A’中的第x行和第y行进行循环右移位,当z=0时,不换位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,记录操作过程#cx/y/z,形成一个子密钥;When k=3, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L3 -L1 ), operate y=1+( y mod(1+L3 -L1 )), operation z=z mod 2, performs cyclic right shift on row x and row y in transformation matrix A', when z=0, no transposition, When z=1, move out the two information exchange positions of the transformation matrix A' and then put them into the transformation matrix A', record the operation process #cx/y/z, and form a sub-key;

当k=4时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L4-L2)),运算y=1+(y mod(1+L4-L2)),运算z=z mod 2,对变换矩阵A’中的第x列和第y列进行循环上移位,当z=0时,不换位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,记录操作过程#dx/y/z,形成一个子密钥;When k=4, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L4 -L2 )), and operate y=1+ (y mod(1+L4 -L2 )), operate z=z mod 2, perform circular shift up on the xth column and yth column in the transformation matrix A', when z=0, no transposition , when z=1, remove the two information exchange positions of the transformation matrix A' and put them into the transformation matrix A', record the operation process #dx/y/z, and form a sub-key;

若第1次运算k时得到的k≠0,构建变换矩阵A’=A,即L1=1、L2=1、L3=m、L4=n,记录操作过程为#fL1/L2/L3/L4,形成第一个子密钥;If k≠0 obtained in the first calculation of k, construct the transformation matrix A'=A, that is, L1 =1, L2 =1, L3 =m, L4 =n, and the recording operation process is #fL1 / L2 /L3 /L4 , forming the first subkey;

步骤5]重复步骤4]共w次,得到m×n的密文矩阵Z;Step 5] repeat step 4] total w times, obtain the ciphertext matrix Z of m * n;

步骤6]将各子密钥依次排列得到密钥。Step 6] Arranging the subkeys in order to obtain the key.

当明文信息不是矩阵形式时,上述步骤1]具体包括以下步骤:用户输入整数m、n,将需要加密的明文信息从左到右、从上到下依次填入m×n矩阵,形成明文信息矩阵A;上述步骤5]具体包括以下步骤:重复步骤4]共w次,得到m×n的密文矩阵Z;按照从左到右、从上到下的方式读取密文矩阵Z,得到密文信息;上述步骤6]具体包括以下步骤:将m、n以及各子密钥依次排列得到密钥。When the plaintext information is not in the form of a matrix, the above step 1] specifically includes the following steps: the user inputs integers m and n, and fills the plaintext information to be encrypted into the m×n matrix from left to right and from top to bottom to form plaintext information Matrix A; the above step 5] specifically includes the following steps: repeat step 4] a total of w times to obtain the ciphertext matrix Z of m×n; read the ciphertext matrix Z from left to right and from top to bottom to obtain Ciphertext information; the above step 6] specifically includes the following steps: arranging m, n and each subkey in order to obtain a key.

上述明文信息可以是文本信息、图形信息、图像信息或流媒体信息。The above plaintext information may be text information, graphics information, image information or streaming media information.

本发明的优点包括:Advantages of the present invention include:

1、加解密速度快:本加密方法属于古典置换加密,加密方法变换简单,采用最基本的移位和换位操作,没有附加特别的变换过程,能利用较少的资源实现快速的加解密过程;1. Fast encryption and decryption speed: This encryption method belongs to classical permutation encryption, the encryption method is simple to transform, adopts the most basic shift and transposition operations, without additional special transformation process, and can realize fast encryption and decryption process with less resources ;

2、加密方法实现简单,适用面广:加密方法原理相对简单,既能利用硬件也可基于软件实现;2. The encryption method is simple to implement and widely applicable: the principle of the encryption method is relatively simple, and it can be realized by using hardware or software;

3、加密方法加密强度高,安全性好:对于n×n的矩阵进行w次变换,加密方法强度可达到nw3. The encryption method has high encryption strength and good security: for w transformations of n×n matrix, the encryption method strength can reach nw ;

4、加密方法适用面广:加密方法即可用于文本加密,也可适用于图形、图像、流媒体等多媒体信息加密。4. The encryption method is applicable to a wide range: the encryption method can be used for text encryption, and also for multimedia information encryption such as graphics, images, and streaming media.

附图说明Description of drawings

图1是本发明加密方法的加密过程示意图。Fig. 1 is a schematic diagram of the encryption process of the encryption method of the present invention.

具体实施方式Detailed ways

一种基于双循环队列移位和换位规则的加密方法如下:An encryption method based on double circular queue shift and transposition rules is as follows:

步骤1]输入整数m、n,将需要加密的明文信息从左到右、从上到下依次填入m×n矩阵,形成明文信息矩阵A;Step 1] Input the integers m and n, and fill in the plaintext information to be encrypted into the m×n matrix from left to right and from top to bottom to form the plaintext information matrix A;

步骤2]创建随机整数序列X={r∈N,r≤max(m,n)};Step 2] Create a sequence of random integers X = {r ∈ N, r ≤ max(m, n)};

步骤3]用户根据加密强度要求,输入一个整数w作为矩阵变换次数;Step 3] The user inputs an integer w as the number of matrix transformations according to the encryption strength requirements;

步骤4]在随机整数序列X中任取随机数k,运算k=k mod 5;Step 4] Random number k is randomly selected in random integer sequence X, and operation k=k mod 5;

当k=0时,从随机整数序列X中取4个随机数L1、L2、L3、L4,要求L1<L3≤m,L2<L4≤n;然后以第L1行作为起始行、以第L3行作为结束行、以第L2列作为起始列、以第L4列作为结束列,构建变换矩阵A’,记录操作过程为#fL1/L2/L3/L4,形成一个子密钥;When k=0, take 4 random numbers L1 , L2 , L3 , L4 from the random integer sequence X, and require L1 <L3 ≤m, L2 <L4 ≤n; then use the Lth Row1 is used as the start row, rowL3 is the end row, columnL2 is the start column, columnL4 is the end column, and the transformation matrix A' is constructed, and the operation process is recorded as #fL1 /L2 /L3 /L4 , forming a subkey;

当k=1时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L3-L1)),运算y=1+(y mod(1+L3-L1)),运算z=z mod 2,对变换矩阵A’中的第x行和第y行进行循环左移位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位,记录操作过程为#ax/y/z,形成一个子密钥;When k=1, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L3 -L1 )), and operate y=1+ (y mod(1+L3 -L1 )), operate z=z mod 2, perform circular left shift on row x and row y in transformation matrix A', when z=1, shift out the transformation The two information of the matrix A' are exchanged and put into the transformation matrix A'. When z=0, no transposition is performed, and the recording operation process is #ax/y/z to form a sub-key;

当k=2时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L4-L2)),运算y=1+(y mod(1+L4-L2)),运算z=z mod 2,对变换矩阵A’中的第x列和第y列进行循环下移位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位,记录操作过程为#bx/y/z,形成一个子密钥;When k=2, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L4 -L2 )), and operate y=1+ (y mod(1+L4 -L2 )), operate z=z mod 2, perform circular shift down on the xth column and yth column in the transformation matrix A', when z=1, then shift out the transformation The two information of the matrix A' are exchanged and put into the transformation matrix A'. When z=0, no transposition is performed, and the recording operation process is #bx/y/z to form a sub-key;

当k=3时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L3-L1)),运算y=1+(y mod(1+L3-L1)),运算z=z mod 2,对变换矩阵A’中的第x行和第y行进行循环右移位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位,则换位,记录操作过程#cx/y/z,形成一个子密钥;When k=3, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L3 -L1 )), and operate y=1+ (y mod(1+L3 -L1 )), operation z=z mod 2, performs circular right shift on row x and row y in the transformation matrix A', when z=1, shift out the transformation The two information of the matrix A' are exchanged and put into the transformation matrix A'. When z=0, do not transpose, then transpose, record the operation process #cx/y/z, and form a sub-key;

当k=4时,从随机整数序列X中任取随机数x、y、z,要求x≠y,运算x=1+(xmod(1+L4-L2)),运算y=1+(y mod(1+L4-L2)),运算z=z mod 2,对变换矩阵A’中的第x列和第y列进行循环上移位,当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位,记录操作过程#dx/y/z,形成一个子密钥;When k=4, randomly select random numbers x, y, z from random integer sequence X, require x≠y, operate x=1+(xmod(1+L4 -L2 )), and operate y=1+ (y mod(1+L4 -L2 )), operate z=z mod 2, perform circular shift up on the xth column and yth column in the transformation matrix A', when z=1, then shift out the transformation The two information of the matrix A' are exchanged and put into the transformation matrix A'. When z=0, no transposition is performed, and the operation process #dx/y/z is recorded to form a sub-key;

若第1次运算k时得到的k≠0,构建变换矩阵A’=A,即L1=1、L2=1、L3=m、L4=n,记录操作过程为#fL1/L2/L3/L4,形成第一个子密钥;If k≠0 obtained in the first calculation of k, construct the transformation matrix A'=A, that is, L1 =1, L2 =1, L3 =m, L4 =n, and the recording operation process is #fL1 / L2 /L3 /L4 , forming the first subkey;

步骤5]重复步骤4]共w次,得到m×4的密文矩阵Z;按照从左到右、从上到下的方式读取密文矩阵Z,得到密文信息;Step 5] Repeat step 4] for a total of w times to obtain the ciphertext matrix Z of m × 4; read the ciphertext matrix Z from left to right and from top to bottom to obtain the ciphertext information;

步骤6]将m、n以及各子密钥依操作次序排列得到密钥,并以文件形成安全存放,密钥文件的格式为m\n#fl1/l2/l3/l4#ax/y/z#bx/y/z……。Step 6] Arrange m, n and each subkey according to the order of operation to obtain the key, and store it safely in a file. The format of the key file is m\n#fl1 /l2 /l3 /l4 #ax /y/z#bx/y/z….

针对上述加密过程,基于双循环队列移位和换位规则的解密过程如下:For the above encryption process, the decryption process based on the double-cycle queue shift and transposition rules is as follows:

步骤1]从密钥文件中取前两个数据m和n,得到密文矩阵Z的行数m和列数n;Step 1] Get the first two data m and n from the key file to obtain the number of rows m and the number of columns n of the ciphertext matrix Z;

步骤2]将密文信息按照从左到右、从上到下的方式依次填入m×n矩阵,形成密文矩阵Z;Step 2] fill in the ciphertext information into the m×n matrix sequentially from left to right and from top to bottom to form a ciphertext matrix Z;

步骤3]在密钥中以#f为子密钥段的分段标志,取最后一个子密钥段;Step 3] In the key, use #f as the segmentation mark of the sub-key segment, and get the last sub-key segment;

步骤4]用子密钥段对密文矩阵的解密操作过程如下:Step 4] the decryption operation process of the ciphertext matrix with the sub-key section is as follows:

以第L1行作为起始行、以第L3行作为结束行、以第L2列作为起始列、以第L4列作为结束列,确定密文矩阵Z的一个变换矩阵Z’;With theL1th row as the starting row, theL3th row as the ending row, theL2th column as the starting column, and theL4th column as the ending column, determine a transformation matrix Z' of the ciphertext matrix Z;

依照从后向前的次序,用子密钥段中的各个子密钥对变换矩阵Z’进行解密操作:According to the order from back to front, the transformation matrix Z' is decrypted with each subkey in the subkey section:

当子密钥为#ax/y/z时,对变换矩阵Z’中的第x行和第y行进行循环右移位;当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位;When the subkey is #ax/y/z, perform a cyclic right shift on the xth row and the yth row in the transformation matrix Z'; when z=1, move out the two information exchanges of the transformation matrix A' The position is put into the transformation matrix A' again, when z=0, no transposition;

当子密钥为#bx/y/z时,对变换矩阵Z’中的第x列和第y列进行循环上移位;当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位;When the subkey is #bx/y/z, cyclically shift up the xth column and yth column in the transformation matrix Z'; when z=1, move out the two information exchanges of the transformation matrix A' The position is put into the transformation matrix A' again, when z=0, no transposition;

当子密钥为#cx/y/z时,对变换矩阵Z’中的第x行和第y行进行循环左移位;当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位;When the subkey is #cx/y/z, perform circular left shift on row x and row y in transformation matrix Z'; when z=1, shift out the two information exchanges of transformation matrix A' The position is put into the transformation matrix A' again, when z=0, no transposition;

当子密钥为#dx/y/z时,对变换矩阵Z’中的第x列和第y列进行循环下移位;当z=1时,则移出变换矩阵A’的两个信息交换位置后再放入变换矩阵A’中,当z=0时,不换位;When the subkey is #dx/y/z, the x-th column and the y-th column in the transformation matrix Z' are cyclically shifted down; when z=1, the two information exchanges of the transformation matrix A' are shifted The position is put into the transformation matrix A' again, when z=0, no transposition;

步骤5]删除该子密钥段;Step 5] delete the subkey segment;

步骤6]重复步骤3]至步骤5],直到密钥为空为止,完成解密操作过程,得到明文矩阵A;Step 6] Repeat step 3] to step 5] until the key is empty, complete the decryption operation process, and obtain the plaintext matrix A;

步骤7]按照从左到右、从上到下读取明文矩阵A,得到明文信息。Step 7] Read the plaintext matrix A from left to right and top to bottom to obtain plaintext information.

以图1为例,采用本发明方法对信息1、2、3……20进行加密,过程如下:Taking Fig. 1 as an example, the method of the present invention is used to encryptinformation 1, 2, 3...20, and the process is as follows:

1、用户输入m=4,n=5,构造明文矩阵A,如图1A;1. The user inputs m=4, n=5 to construct a plaintext matrix A, as shown in Figure 1A;

2、用户输入加密强度w=6;2. User input encryption strength w=6;

3、创建随机整数序列X={3,4,5,1,4,5,3,2,……};3. Create a random integer sequence X={3, 4, 5, 1, 4, 5, 3, 2,...};

4、第一次操作过程:在随机整数序列X中任取k=5,运算k=k mod 5=0,则在随机整数序列X取L1=2、L2=3、L3=4、L4=5,选取明文矩阵A的第2行至第4行、第3列至第5列的构建变换矩阵A’,如图1B中黑框部分所示,记录操作为#f2/3/4/5,作为一个子密钥;4. The first operation process: randomly select k=5 in the random integer sequence X, and operate k=k mod 5=0, then take L1 =2, L2 =3, L3 =4 in the random integer sequence X , L4=5, select the construction transformation matrix A' from the 2nd row to the 4th row, the 3rd column to the 5th column of the plaintext matrix A, as shown in the black box part in Figure 1B, the recording operation is #f2/3/ 4/5, as a subkey;

5、第二次操作过程:在随机整数序列X中任取k=4,运算k=k mod 5=4,则在随机整数序列X中任取x=4,y=5、z=1,运算x=1+(x mod(1+L4-L2))=2,运算y=1+(y mod(1+L4-L2))=3,运算z=z mod 2=1,对变换矩阵A’的第2列和第3列进行向上的循环移位,并换位,形成如图1C的结果,记录操作过程为#d2/3/1,作为一个子密钥;5. The second operation process: randomly select k=4 in the random integer sequence X, and operate k=k mod 5=4, then randomly select x=4, y=5, z=1 in the random integer sequence X, Operation x=1+(x mod(1+L4 -L2 ))=2, operation y=1+(y mod(1+L4 -L2 ))=3, operation z=z mod 2=1 , perform an upward circular shift on the second column and the third column of the transformation matrix A', and transpose to form the result shown in Figure 1C, and record the operation process as #d2/3/1 as a subkey;

6、第三次操作过程:在随机整数序列X中任取k=3,运算k=k mod 5=3,则在随机整数序列X中任取x=5,y=3、z=2,运算x=1+(x mod(1+L4-L2))=3,运算y=1+(y mod(1+L4-L2))=1,运算z=z mod 2=0,对变换矩阵A’的第1行和第3行进行向右的循环移位,形成如图1D的结果,记录操作过程为#c3/1/0,作为一个子密钥;6. The third operation process: randomly select k=3 in the random integer sequence X, and operate k=k mod 5=3, then randomly select x=5, y=3, z=2 in the random integer sequence X, Operation x=1+(x mod(1+L4 -L2 ))=3, operation y=1+(y mod(1+L4 -L2 ))=1, operation z=z mod 2=0 , cyclically shift the first row and the third row of the transformation matrix A' to the right to form the result shown in Figure 1D, and record the operation process as #c3/1/0 as a subkey;

7、第四次操作过程:在随机整数序列X中任取k=0,运算k=k mod 5=0,再在随机整数序列X中取L1=1、L2=1、L3=3、L4=4,选取第1行至第3行、第1列至第4列的变换矩阵A”,如图1E中黑框部分所示,记录操作过程为#f1/1/3/4,作为一个子密钥;7. The fourth operation process: randomly select k=0 in the random integer sequence X, operate k=k mod 5=0, and then take L1 =1, L2 =1, L3 = in the randominteger sequence X 3. L4=4, select the transformation matrix A" from the 1st row to the 3rd row, and the 1st column to the 4th column, as shown in the black box in Figure 1E, the recording operation process is #f1/1/3/4 , as a subkey;

8、第五次操作过程:在随机整数序列X中任取k=1,运算k=k mod 5=1,再在随机整数序列X中任取x=3,y=5、z=1,运算x=1+(x mod(1+L3-L1))=1,运算y=1+(y mod(1+L3-L1))=3,运算z=z mod 2=1,对变换矩阵A”的第1行和第3行进行向左的循环移位,并换位,形成如图1F的结果,记录操作过程为#a1/3/1,作为一个子密钥;8. The fifth operation process: randomly select k=1 in the random integer sequence X, operate k=k mod 5=1, then randomly select x=3, y=5, z=1 in the random integer sequence X, Operation x=1+(x mod(1+L3 -L1 ))=1, operation y=1+(y mod(1+L3 -L1 ))=3, operation z=z mod 2=1 , cyclically shift the first row and the third row of the transformation matrix A" to the left, and transpose to form the result shown in Figure 1F. The recording operation process is #a1/3/1, which is used as a subkey;

9、第六次操作过程:在随机整数序列X中任取k=2,运算k=k mod 5=2,再在随机整数序列X中任取x=3,y=1、z=1,运算x=1+(x mod(1+L4-L2))=4,运算y=1+(y mod(1+L4-L2))=2,运算z=z mod 2=0,对变换矩阵A”的第4列和第2列进行向下的循环移位,形成如图1G的结果,记录操作过程为#b4/2/0,作为一个子密钥;9. The sixth operation process: randomly select k=2 in the random integer sequence X, operate k=k mod 5=2, and then randomly select x=3, y=1, z=1 in the random integer sequence X, Operation x=1+(x mod(1+L4 -L2 ))=4, operation y=1+(y mod(1+L4 -L2 ))=2, operation z=z mod 2=0 , perform downward cyclic shift on the 4th column and the 2nd column of the transformation matrix A", forming the result as shown in Figure 1G, the recording operation process is #b4/2/0, as a sub-key;

10、得到密钥:4\5#f2/3/4/5#d2/3/1#c3/1/0#f1/1/3/4#a1/3/1#b4/2/0;密文为:2、13、4、1、5、6、3、15、11、14、12、7、19、8、20、16、17、9、18、10。10. Get the key: 4\5#f2/3/4/5#d2/3/1#c3/1/0#f1/1/3/4#a1/3/1#b4/2/0; The ciphertext is: 2, 13, 4, 1, 5, 6, 3, 15, 11, 14, 12, 7, 19, 8, 20, 16, 17, 9, 18, 10.

对密文为:2、13、4……16、17、9、18、10进行解密的过程如下:The process of decrypting the ciphertext: 2, 13, 4...16, 17, 9, 18, 10 is as follows:

1、从密钥中取前两个数字4和5,得到密文矩阵Z为4行和5列,将密文2、13、4、1、5、6、3、15、11、14、12、7、19、8、20、16、17、9、18、10填入4×5的密文矩阵Z中;1. Take the first twonumbers 4 and 5 from the key, and get the ciphertext matrix Z with 4 rows and 5 columns. Theciphertext 2, 13, 4, 1, 5, 6, 3, 15, 11, 14, 12, 7, 19, 8, 20, 16, 17, 9, 18, 10 are filled in the 4×5 ciphertext matrix Z;

2、在密钥中以#f为子密钥段的分段标志,取最后一个子密钥段#f1/1/3/4#a1/3/1#b4/2/0;2. In the key, use #f as the segmentation mark of the sub-key segment, and take the last sub-key segment #f1/1/3/4#a1/3/1#b4/2/0;

3、以第1行作为起始行、以第3行作为结束行、以第1列作为起始列、以第4列作为结束列,确定密文矩阵Z的一个变换矩阵Z”,见图1G黑框部分;3. With the first row as the starting row, the third row as the ending row, the first column as the starting column, and the fourth column as the ending column, determine a transformation matrix Z of the ciphertext matrix Z", as shown in the figure 1G black frame part;

4、取最后一个子密钥#b4/2/0,对变换矩阵Z”中的第4列和第2列进行循环上移位,得图1F;4. Take the last subkey #b4/2/0, and perform a cyclic upshift on the 4th column and the 2nd column in the transformation matrix Z", to get Figure 1F;

5、再取倒数第二个子密钥#a1/3/1,对变换矩阵Z”中的第1行和第3行进行循环右移位,并换位,得图1E;5. Take the second-to-last subkey #a1/3/1, perform circular right shift on the first and third rows in the transformation matrix Z", and transpose, to get Figure 1E;

6、删除最后一个子密钥段#f1/1/3/4#a1/3/1#b4/2/0;6. Delete the last subkey segment #f1/1/3/4#a1/3/1#b4/2/0;

7、取密钥中的最后一个子密钥段#f2/3/4/5#d2/3/1#c3/1/0;7. Take the last subkey segment #f2/3/4/5#d2/3/1#c3/1/0 in the key;

8、以第2行作为起始行、以第4行作为结束行、以第3列作为起始列、以第5列作为结束列,确定密文矩阵Z的一个变换矩阵Z’,见图1D黑框部分;8. With the 2nd row as the starting row, the 4th row as the ending row, the 3rd column as the starting column, and the 5th column as the ending column, determine a transformation matrix Z' of the ciphertext matrix Z, as shown in the figure 1D black frame part;

9、取最后一个子密钥#c3/1/0,对变换矩阵Z’中的第3行和第1行进行循环左移位,得图1C;9. Take the last subkey #c3/1/0, and perform circular left shift on the third row and the first row in the transformation matrix Z', to get Figure 1C;

10、再取倒数第二个子密钥#d2/3/1,对变换矩阵Z’中的第2列和第3列进行循环下移位,并换位,得图1B;10. Take the second-to-last subkey #d2/3/1, perform a circular shift on the second column and the third column in the transformation matrix Z', and transpose, to get Figure 1B;

12、删除最后一个子密钥段#f2/3/4/5#d2/3/1#c3/1/0;完成解密操作过程,得到明文矩阵A;12. Delete the last subkey segment #f2/3/4/5#d2/3/1#c3/1/0; complete the decryption operation process and obtain the plaintext matrix A;

13、按照从左到右、从上到下读取明文矩阵A,得到明文信息1、2、3、4、5、6……19、20。13. Read the plaintext matrix A from left to right and top to bottom to obtainplaintext information 1, 2, 3, 4, 5, 6...19, 20.

本发明的技术基础:Technical basis of the present invention:

1、循环队列,是一种基本的数据结构。对于一个有序数据序列X={x1,x2,……,xn-1,xn,n>2},定义了移动操作R=(r,r),对X的r操作为X’={xn,x1,x2,……,xn-1,n>2}即正向循环移动,对X的r操作为X’={x2,……,xn-1,xn,x1,n>2}即反向循环移动;1. A circular queue is a basic data structure. For an ordered data sequence X={x1 , x2 ,..., xn-1 , xn , n>2}, the move operation R=(rpositive , rnegative ) is defined, and the rpositive of X The operation is X'={xn , x1 , x2 ,..., xn-1 , n>2}, that is, the forward circular movement, andthe inverse operation of X is X'={x2 ,..., xn-1 , xn , x1 , n>2} means reverse circular movement;

2、对于一个m*n矩阵A(或其任一子阵A’),将其行或列可分别看作循环队列,这样就有行的左移和右移或列的下移和上移4种操作方式;2. For an m*n matrix A (or any sub-array A'), its rows or columns can be regarded as circular queues, so that there are left and right shifts of rows or down and up shifts ofcolumns 4 operation modes;

3、双循环队列:将矩阵A(或其任一子阵A’)的两行或两列看作队列,同时进行移动操作;3. Double circular queue: regard two rows or two columns of the matrix A (or any sub-array A') as a queue, and perform the moving operation at the same time;

4、换位:双循环队列移动时,移出矩阵A(或其任一子阵A’)的两个数据,交换位置放入矩阵中。4. Transposition: when the double-circulation queue moves, two data of the matrix A (or any sub-array A' thereof) are removed, and the exchange positions are put into the matrix.

Claims (3)

CN200810017494A2008-02-032008-02-03 An Encryption Method Based on Double Circular Queue Shift and Transposition RulesExpired - Fee RelatedCN100589380C (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN200810017494ACN100589380C (en)2008-02-032008-02-03 An Encryption Method Based on Double Circular Queue Shift and Transposition Rules

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN200810017494ACN100589380C (en)2008-02-032008-02-03 An Encryption Method Based on Double Circular Queue Shift and Transposition Rules

Publications (2)

Publication NumberPublication Date
CN101237322A CN101237322A (en)2008-08-06
CN100589380Ctrue CN100589380C (en)2010-02-10

Family

ID=39920698

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN200810017494AExpired - Fee RelatedCN100589380C (en)2008-02-032008-02-03 An Encryption Method Based on Double Circular Queue Shift and Transposition Rules

Country Status (1)

CountryLink
CN (1)CN100589380C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107968705A (en)*2017-11-282018-04-27深圳大学A kind of method for encryption/decryption, enciphering/deciphering end and double random phase encrypting and deciphering system

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101425170A (en)*2008-11-252009-05-06李东声Dynamic password implementing method, system and device
CN101895389B (en)*2010-07-162012-06-06黑龙江大学Methods for encrypting and decrypting combined coding based file by adopting proportion calculation
CN101938350B (en)*2010-07-162012-06-06黑龙江大学File encryption and decryption method based on combinatorial coding
CN102271036B (en)*2011-08-292014-10-15田耕Method for encrypting digital signal by utilizing matrixes
CN113744436B (en)*2021-09-022023-05-23中广核永寿新能源有限公司Internet of things fan cabin door safety error-prevention control method based on electric power two-ticket management
CN116311621A (en)*2023-03-232023-06-23天津天优科技股份有限公司Digital password encryption and decryption method for intelligent door lock

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
EP0278740A2 (en)*1987-02-101988-08-17Veritec, Inc.A method for encrypting a code and an encryption device
CN1425987A (en)*2001-12-102003-06-25中国科学院软件研究所Encrypting method for reinforcing disordered block cipher
CN1773906A (en)*2004-11-102006-05-17谢道裕Magic square signature method for true or false identification

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
EP0278740A2 (en)*1987-02-101988-08-17Veritec, Inc.A method for encrypting a code and an encryption device
CN1425987A (en)*2001-12-102003-06-25中国科学院软件研究所Encrypting method for reinforcing disordered block cipher
CN1773906A (en)*2004-11-102006-05-17谢道裕Magic square signature method for true or false identification

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AES算法的高速实现. 蔡宇东,沈海斌,严晓浪.微电子学与计算机,第21卷第1期. 2004*
数据加密标准算法的DSP实现. 关宗安,仲丛久.数据采集与处理,第21卷增刊卷. 2006*

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107968705A (en)*2017-11-282018-04-27深圳大学A kind of method for encryption/decryption, enciphering/deciphering end and double random phase encrypting and deciphering system

Also Published As

Publication numberPublication date
CN101237322A (en)2008-08-06

Similar Documents

PublicationPublication DateTitle
CN101237321A (en) Encryption Method Based on Circular Queue Shifting Rule
CN100589380C (en) An Encryption Method Based on Double Circular Queue Shift and Transposition Rules
Li et al.Reversible data hiding in encrypted images using cross division and additive homomorphism
CN104363091B (en)A kind of encipher-decipher method of automatically retrieval key and selection algorithm
CN102982499B (en)Based on color image encryption and the decryption method of multi-fractional order chaos system
CN109660696B (en)New image encryption method
Wu et al.A new color image encryption scheme using CML and a fractional-order chaotic system
JP4967544B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
CN112134688B (en) An asymmetric image encryption method based on quantum chaos mapping and SHA-3
CN109150492B (en)Multi-image encryption method based on three-dimensional scrambling model and chaos
CN106327414B (en) A double chaotic image encryption method based on the characteristics of plaintext itself
JP2021022924A (en)High speed encryption key generating engine
CN110535624B (en) A medical image privacy protection method applied to DICOM format
US20070189518A1 (en)3-D quaternion quantum fractal encryption
CN107220923A (en)Digital picture feedback encryption method based on image network
CN105513002A (en)Novel image encryption method based on correlation between chaos and plaintext
Goel et al.A technique for image encryption with combination of pixel rearrangement scheme based on sorting group-wise of RGB values and explosive inter-pixel displacement
CN113572786A (en) A method for encryption and decryption based on plaintext composed of unequal length binary intercept words
Al-Muhammed et al.κ-lookback random-based text encryption technique
CN116055650B (en) Urine test strip image encryption method based on DES
CN113645021A (en)Information hiding method and system based on elliptic curve cryptography
Wu et al.ElGamal algorithm for encryption of data transmission
CN109618073A (en) A Multi-Graph Encryption Method Based on Hyperchaotic Chen System
CN115484019A (en) An Improved Algorithm for AES Key Expansion with Weak Correlation
CN110879894B (en)Image encryption and decryption method based on lazy scale transformation and random layered fusion

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
C17Cessation of patent right
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20100210

Termination date:20110203


[8]ページ先頭

©2009-2025 Movatter.jp