RC2密碼編譯演算法

來源:互聯網
上載者:User

標籤:

1.introduction

RC2是一種傳統的私密金鑰塊密碼編譯演算法,曾經被考慮作為DES演算法的替代品。輸入和輸出塊大小都是64bits。而密鑰是可變的,從1byte到128bytes,現在常用的是8位元組。

1.1Algorithm description

字:16位元位;‘+’:加;‘&’:表示位元敏感的與操作;‘XOR’:表示位元敏感的與或操作;‘~’:表示換位補碼;‘^’:表示取冪運算;

2.key expansion(密鑰擴充)

對於字操作,將規定緩衝位置K[0],…,K[63];each K[i] is a 16 bit word

對於位元位操作,將規定緩衝位置L[0],…,L[127];each L[i] is an eight-bit位元組。

轉換公式:K[i] = L[2*i] + 256*L[2*i+1].

密鑰擴張的目的就是根據提供的密鑰將其擴張成要求的密鑰長度。

3.Encryption algorithm(密碼編譯演算法)

主要是兩個操作,mix和mash操作。’x rol k’表示16位元位左轉k位,高位補低位。

   3.1 Mix up R[i]

   3.2 Mixing round

   3.3 Mash R[i]

   3.4 Mashing round

   3.5 Encryption operation 

4.Decryption algorithm(解密演算法)

   4.1 R-Mix up R[i]

   4.2 R-Mixing round

   4.3 R-Mash R[i]

   4.4 R-Mashing round

   4.5 Decryption operation

 

參考文獻:RFC 2268

RC2密碼編譯演算法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.