美文网首页
Show that DES decryption is, in

Show that DES decryption is, in

作者: fruits_ | 来源:发表于2017-10-10 17:59 被阅读0次

    首先DES的流程:

    • IP First, the 64-bit plaintext passes through an initial permutation.
    • 16Rounds of the same function
    • 32-bit swap
    • IP^(-1) Inverse initial permutation

    而With the exception of the initial and final permutations, DES has the exact structure of a Feistel cipher.

    所以我们先来看看Feistel cipher

    对于16轮的Feistel cipher,Input(plaintext)分成2组,每组32位,左右分别为LEi与REi,i为轮数
    根据其结构有2个式子,记为式组1

    LEi = REi-1  
    REi = LEi-1 ⊕ F(REi-1,Ki) 
    

    按轮数依次执行,直至第16轮完结,预输出是 LE16 RE16
    经过一个置换,得到密文为 RE16LE16

    以此作为原始装置的输入解密,但注意Key必须从K16...K1 ,调用有

    LD0 = RE16  
    RD0 = LE16  
    

    此时我们重新看式组1

    LE16 = RE15
    RE16 = LE15 ⊕ F(RE15, K16)
    则
    LD1 = RD0 = LE16 = RE15
    RD1 = LD0 ⊕ F(RD0, K16)
        = RE16 ⊕ F(RE15, K16)
        = [LE15 ⊕ F(RE15, K16)] ⊕ F(RE15, K16)
        /*根据异或的结合率*/
        = LE15
    

    即有解密第1轮输出是加密第16轮输入左右部分互换的值.
    解密第2轮输出是加密第15轮输入左右部分互换的值,结构相同,则可得
    解密第i轮输出是加密第17-i轮输入左右部分互换的值
    解密第16轮输出是加密第1轮输入左右部分互换的值
    即RE0 LE0
    再经过Feistel最后的32bit swap,得第一轮原始输入 LE0 RE0

    以上说明 Feistel cipher结构加解密可同用一个结构,即加密和解密互逆

    而DES前后加入了IP和IP-1,假设64bit plaintext分开为L0,R0
    则对于DES中的Feistel结构而言,输入为IP(L0,R0),记为LE0,RE0,输出为RE16,LE16
    出来再经过一次IP-1,最终输出为IP-1(RE16,LE16
    以此作为解密的输入,由于IP与IP-1互逆
    经解密DES中的IP处理后,解密Feistel结构的输入其实就是
    RE16,LE16,然后根据之前Feistel结构的总结,得Feistel部分的输出为LE0,RE0
    即IP(L0,R0), 最后经DES的IP-1函数处理,即得原文L0,R0,毕。

    相关文章

      网友评论

          本文标题:Show that DES decryption is, in

          本文链接:https://www.haomeiwen.com/subject/eoyvyxtx.html