文件名称:Cipher
介绍说明--下载内容均来自于网络,请自行研究使用
置换密码算法的原理是不改变明文字符,只将字符在明文中的排列顺序改变,从而实现明文信息的加密。置换密码也叫换位密码。
试编程实现矩阵换位密码。它的加密方法是将明文中的字母按照给定的顺序安排在一个矩阵中,然后用根据密钥提供的顺序重新组合矩阵中的字母,形成密文。例如,明文为attack begins at five,密钥为cipher,将明文按照每行6个字母的形式排在矩阵中,如下形式:
a t t a c k
b e g i n s
a t f i v e
根据密钥cipher中各字母在字母表中出现的先后顺序,给定一个置换:
根据上面的置换,将原有矩阵中的字母按照第1、4、5、3、2、6的顺序排列,则有下列形式:
a a c t t k
b i n g e s
a i v f t e
从而得到密文:aacttkbingesaivfte
解密过程类推。
-The principle of permutation cipher algorithm is to change the order of characters in plaintext without changing the plaintext characters, so as to realize the encryption of plaintext information. Permutation cipher is also called transposition cipher.
Programming to achieve matrix transposition password. Its encryption method is that the letters in the plaintext are arranged in a matrix according to a given order, and then the letters in the matrix are re assembled in the order provided by the key to form a ciphertext. For example, the plaintext is attack begins at five, the key is cipher, and the plaintext is placed in the matrix in the form of 6 letters per row, as follows:
A, t, t, a, C, K
B, e, G, I, N, s
A, t, F, I, V, e
According to the order in which the letters in the key cipher appear in the alphabet, a permutation is given:
According to the above permutation, the letters in the original matrix are arranged in the order of first, fourth, fifth, 3, 2 and 6, and the follo
试编程实现矩阵换位密码。它的加密方法是将明文中的字母按照给定的顺序安排在一个矩阵中,然后用根据密钥提供的顺序重新组合矩阵中的字母,形成密文。例如,明文为attack begins at five,密钥为cipher,将明文按照每行6个字母的形式排在矩阵中,如下形式:
a t t a c k
b e g i n s
a t f i v e
根据密钥cipher中各字母在字母表中出现的先后顺序,给定一个置换:
根据上面的置换,将原有矩阵中的字母按照第1、4、5、3、2、6的顺序排列,则有下列形式:
a a c t t k
b i n g e s
a i v f t e
从而得到密文:aacttkbingesaivfte
解密过程类推。
-The principle of permutation cipher algorithm is to change the order of characters in plaintext without changing the plaintext characters, so as to realize the encryption of plaintext information. Permutation cipher is also called transposition cipher.
Programming to achieve matrix transposition password. Its encryption method is that the letters in the plaintext are arranged in a matrix according to a given order, and then the letters in the matrix are re assembled in the order provided by the key to form a ciphertext. For example, the plaintext is attack begins at five, the key is cipher, and the plaintext is placed in the matrix in the form of 6 letters per row, as follows:
A, t, t, a, C, K
B, e, G, I, N, s
A, t, F, I, V, e
According to the order in which the letters in the key cipher appear in the alphabet, a permutation is given:
According to the above permutation, the letters in the original matrix are arranged in the order of first, fourth, fifth, 3, 2 and 6, and the follo
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Cipher.txt