Berlin
发布于 2025-03-14 / 35 阅读
3
0

简化数据加密标准(SDES)计算原理|Simplified DES (SDES) Calculation Principles

1. Introduction | 简介

Simplified DES (SDES) is a simplified version of the Data Encryption Standard (DES), designed to help understand the DES encryption mechanism. While SDES is not cryptographically secure, it provides a foundation for understanding symmetric-key encryption.

简化数据加密标准(SDES)是数据加密标准(DES)的简化版本,旨在帮助理解 DES 加密机制。虽然 SDES 在密码学上并不安全,但它提供了理解对称密钥加密的基础。


2. Key Generation | 密钥生成

In SDES, a 10-bit key is used to generate two subkeys (K1 and K2). The key generation process involves three main steps:

在 SDES 中,使用 10 位密钥生成两个子密钥(K1 和 K2)。密钥生成过程包括以下三个主要步骤:

  1. Permutation P10 (Given value)
    置换 P10(给定值)

  1. Permutation P8 (Given value)
    置换 P8(给定值)

For example, given a key 1100011110, we obtain the following:

例如,给定密钥 1100011110,计算过程如下:

(注意:这里k1的shift是分开的左右两部分各自左移动一个位置。比如:P10(K): 00110 01111,则ShiftP10(K): 01100 11110。k2则是左移动三个位置)

Thus, we obtain K1 = 11101001 and K2 = 10100111.

因此,我们得到了 K1 = 11101001K2 = 10100111


3. S-Boxes (Given values) | S-盒(给定值)

S-Boxes are used for substitution in the SDES algorithm. SDES has two S-Boxes: S0 and S1.

S-Box 用于 SDES 算法中的替换操作。SDES 具有两个 S-盒:S0 和 S1。


4. Initial and Final Permutation | 初始和最终排列

The plaintext undergoes an initial permutation when it enters the encryption function, IP. It undergoes a reverse final permutation at the end IP−1 .

明文在进入加密函数IP时进行初始排列。最终在IP−1的末端进行反向排列。

  1. IP (给定值)

  1. IP-1 (给定值)

  1. Applied to the input, we have the following after the initial permutationThe plaintext value is set to 0010 1000:


5. Functions fk, SW, K | 计算fk, SW, K

• The function fk is defined as follows. Let P = (L, R), then fk(L, R) = (L F (R, SK), R).

• The function SW just switches the two halves of the plaintext, so SW(L, R) → (R, L)

• The function F (p, k) takes a four bit string p and eight bit key k and produces a four bit output. It performs the following steps.

  1. E/P (给定值)

  1. Permutation P4 (Given value)
    置换 P4(给定值)

  1. The steps are:

(注意:看SBoxes是有规律的,同样也是分开左右两部分,左边的看S0,右边的看S1。并且对应的是中间看列,两边看行。比如:1111 1101,左边的为1111,取中间的“11”为列,取两边的“11”为行,看S0,得到10。右边的为1101,取中间的“10”为列,取两边的“11”为行,看S1,得到00。)

  1. The result from F is therefore 0001

  2. Calculating we then have fk1(L, R) = (0010 ⊕ 0001, 0010) = (0011, 0010) (这个0010 ⊕ 0001的0010是左半部分的值)

  3. So far, then L = 0011 and R = 0010. SW just swaps them so R = 0011 and L = 0010.

  4. We now do the calculation of fk2(L, R) = f{1010 0111}(0010 0011) = (0010⊕F (0011, {1010 0111}, 0011))

  5. The steps for F are as above:

  1. So now we have the outcome of F as 0011

  2. Calculating we then have fk2(L, R) = (0010 ⊕ 0011, 0011) = (0001, 0011)

  3. Last, we perform the IP−1 permutation:

  1. So the final result of the encryption is 1000 1010.


评论