密码学,把字母转换为数字_密码学转换技术

2023-01-02 00:00:00 转换为 字母 密码学

密码学,把字母转换为数字

Transposition Techniques are based on the permutation of the plain-text instead of substitution.

换位技术基于纯文本的置换而不是置换。

1)围栏技术 (1) Rail-Fence Technique)

This technique is a type of Transposition technique and does is write the plain text as a sequence of diagonals and changing the order according to each row.

此技术是一种转置技术,确实将纯文本编写为对角线序列,并根据每一行更改顺序。

It uses a simple algorithm,

它使用简单的算法

  1. Writing down the plaintext message into a sequence of diagonals.

    将纯文本消息写成对角线序列。

  2. Row-wise writing the plain-text written from above step.

    以行方式写入从上述步骤中写入的纯文本。

Example,

例,

Let’s say, we take an example of “INCLUDEHELP IS AWESOME”.

比方说,我们举一个“包容一切真棒”的例子。

《密码学,把字母转换为数字_密码学转换技术》

So the Cipher-text are, ICUEEPSWSMNLDHLIAEOW.

因此,密码文本为ICUEEPSWSMNLDHLIAEOW

First, we write the message in a zigzag manner then read it out direct row-wise to change it to cipher-text.

首先,我们以Z字形的方式编写消息,然后直接逐行读出以将其更改为密文。

Now as we can see, Rail-Fence Technique is very to break by any cryptanalyst.

现在,正如我们所看到的,Rail-Fence技术很容易被任何密码分析者打破。

2)柱状过渡技术 (2) Columnar Transition Technique)

A. Basic Technique

A.基本技术

It is a slight variation to the Rail-fence technique, let’s see its algorithm:

它与Rail-fence技术略有不同,请看一下它的算法:

  1. In a rectangle of pre-defined size, write the plain-text message row by row.

    在预定义大小的矩形中,逐行写入纯文本消息。

  2. Read the plain message in random order in a column-wise fashion. It can be any order such as 2, 1, 3 etc.

    以列方式随机读取原始消息。 它可以是任意顺序,例如2、1、3等。

  3. Thus Cipher-text is obtained.

    这样就获得了密文。

Let’s see an example:

让我们来看一个例子:

Original message: “INCLUDEHELP IS AWESOME”.

原始消息: “包容真棒”

Now we apply the above algorithm and create the rectangle of 4 columns (we decide to make a rectangle with four column it can be any number.)

现在,我们应用上述算法并创建一个4列的矩形(我们决定制作一个四列的矩形,它可以是任意数字。)

《密码学,把字母转换为数字_密码学转换技术》

Now let’s decide on an order for the column as 4, 1, 3 and 2 and now we will read the text in column-wise.

现在让我们确定该列的顺序为4、1、3和2,现在我们将逐列阅读文本。

Cipher-text: LHIEEIUESSCEPWMNDLAO

密文: LHIEEIUESSCEPWMNDLAO

B. Columnar Technique with multiple rounds

B.多轮圆柱技术

In this method, we again change the chipper text we received from a Basic technique that is in round 1 and again follows the same procedure for the cipher-text from round 1.

在此方法中,我们再次更改从第1轮的基本技术中收到的削片程序文本,并对第1轮的密文再次执行相同的过程。

Algorithm:

算法:

  1. In a rectangle of pre-defined size, write the plain-text message row by row.

    在预定义大小的矩形中,逐行写入纯文本消息。

  2. Read the plain message in random order in a column-wise fashion. It can be any order such as 2, 1, 3 etc.

    以列方式随机读取原始消息。 它可以是任意顺序,例如2、1、3等。

  3. Thus, Cipher-text of round 1 is obtained.

    因此,获得了第一轮的密文。

  4. Repeat from step 1 to 3.

    从步骤1到3重复。

Example:

例:

Original message: “INCLUDEHELP IS AWESOME”.

原始消息: “包容真棒”

Now we apply the above algorithm and create the rectangle of 4 column (we decide to make a rectangle with four column it can be any number.)

现在,我们应用上述算法并创建4列矩形(我们决定制作一个四列矩形,它可以是任意数字。)

《密码学,把字母转换为数字_密码学转换技术》

Now let’s decide on an order for the column as 4, 1, 3 and 2 and now we will read the text in column-wise.

现在让我们确定该列的顺序为4、1、3和2,现在我们将逐列阅读文本。

Cipher-text of round 1: LHIEEIUESSCEPWMNDLAO

第一轮的密文: LHIEEIUESSCEPWMNDLAO

Round 2:

第二回合

《密码学,把字母转换为数字_密码学转换技术》

Now, we decide to go with a previous order that is 4,1,3,2.

现在,我们决定采用先前的顺序4,1、3、2。

Cipher-text: EEENLESPICUMHISW

密文: EEENLESPICUMHISW

These multi-round columnar techniques are harder to crack as compared to methods seen earlier.

与以前看到的方法相比,这些多轮柱状技术更难破解。

3)Vernam密码(一次性键盘) (3) Vernam Cipher (One-Time Pad))

The Vernam Cipher has a specific subset one-time pad, which uses input ciphertext as a random set of non-repeating character. The thing to notice here is that, once an input cipher text gets used it will never be used again hence one-time pad and length of cipher-text is the size that of message text.

Vernam密码具有一个特定的子集一次性垫 ,该将输入密文用作随机的非重复字符集。 这里要注意的是,一旦使用了输入密文,它将永远不会再被使用,因此,一次填充和密文的长度就是消息文本的大小。

Algorithm:

算法:

  1. Plain text character will be represented by the numbers as A=0, B=1, C=2,… Z=25.

    纯文本字符将由数字表示为A = 0,B = 1,C = 2,… Z = 25

  2. Add each corresponding number of a plain text message to the input cipher text alphabet numbers.

    将每个相应的纯文本消息编号添加到输入的密文字母数字中。

  3. If the sum is greater than or equal to 26, subtract 26 from it.

    如果总和大于或等于26,请从中减去26。

  4. Translate each number back to corresponding letters and we got our cipher text.

    将每个数字翻译回相应的字母,我们得到了密文。

Example:

例:

Our message is “INCLUDEHELP” and input cipher text is “ATQXRZWOBYV”

我们的消息是“ INCLUDEHELP” ,输入的密文是“ ATQXRZWOBYV”

《密码学,把字母转换为数字_密码学转换技术》

One time pad should be discarded after every single use and this technique is proved highly secure and suitable for small messages but illogical if used for long messages.

每次使用后都应丢弃一个时间垫,事实证明该技术非常安全,适用于小消息,但如果用于长消息则不合逻辑。

4)书本/运行密码 (4) Book/Running-Key Cipher)

This technique also (incorrectly) known as running key cipher. This technique very simple and similar to our previous Vernam Cipher. For getting a cipher, some portion of text from a book is used as a one-time pad, rest it works in same way as Vernam cipher does.

此技术也(不正确地)称为运行密钥密码。 这种技术非常简单,类似于我们之前的Vernam Cipher。 为了获得密码,将一本书中的一部分文本用作一次性密码,其余部分的工作方式与Vernam密码相同。

翻译自: https://www.includehelp.com/cryptography/cryptography-transposition-techniques.aspx

密码学,把字母转换为数字

    原文作者:cumt30111
    原文地址: https://blog.csdn.net/cumt30111/article/details/107797975
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。

相关文章