密码学基础(06) Stream cipher 復大辱软件学院 LiJT
LiJT 1 gÉbXË06 Stream Cipher
Stream Cipher Simple Stream Ciphers Attacks on Stream Ciphers Random bit generation RC4 Algorithm 復大辱软件学院 LiST
LiJT 2 Stream Cipher • Simple Stream Ciphers • Attacks on Stream Ciphers • Random Bit Generation • RC4 Algorithm
A Simple Stream Cipher ·使用0-1串作为密钥 明文位流使用X○R加密后得到密文位流 ·使用同样的密钥由密文位流使用XOR解密得 到明文位流 plaintext plaintext XOR XOR Key stream Key stream 復大辱软件学院 LiJT
LiJT A Simple Stream Cipher • )¾0-1(g“ • %³)¾XORCgSxAg%³ • )¾R¥Âg“¿g%³)¾XORãgx A%³ plaintext Key stream XOR XOR Key stream plaintext
XOR Function XOR Operation,真值表: 模2加法(A+BMod2同样的真值表(本课不做区分) B F 0 A XOR B A0011 0 0110 A will be the plaintext and b the key 復大辱软件学院 LiJT
LiJT XOR Function • XOR Operation Æ-à • ¨2C± (A+B)Mod 2 R¥ÂÆ-à(ì/b<) A B F A B F 0 0 0 0 1 1 1 0 1 1 1 0 A will be the plaintext and B the key XOR
Bit stream Encryption and Decryption plaintext:1‖00 011001110101001 y o111101010011001100 ciphertext 0110011101100101 key:[oo山1101010011001100 p1 intext:1001011001110101001 Recall Vernam cipher: Ci=PieRi Pi=CioKi 復大辱软件学院 LiJT
LiJT Bit Stream • Encryption and Decryption: plaintext: 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 key: 0 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 ciphertext: 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 1 key: 0 0 1 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 plaintext: 1 0 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 Ci=PiKi Pi=CiKi Recall Vernam cipher: