Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม

ความแตกต่างระหว่าง Block Cipher และ Stream Cipher


ทั้ง Block และ Stream cipher เป็นวิธีการเข้ารหัส (Encryption) ที่ใช้แปลง plain text เป็น cipher text โดยตรง และอยู่ในกลุ่ม symmetric key ciphers

ความแตกต่างสำคัญระหว่าง Block Cipher และ Stream Cipher มีดังนี้:

Sr. No.KeyBlock CipherStream Cipher
1Definition (นิยาม)Block Cipher คือประเภทการเข้ารหัสที่แปลง plain text โดยรับ block ทีละ blockStream Cipher คือประเภทการเข้ารหัสที่แปลง plain text โดยรับทีละ byte ของ plain text
2Conversion of Bits (การแปลงบิต)เนื่องจาก Block Cipher รับ block ทีละครั้ง จึงแปลงบิตได้มากกว่า Stream Cipher โดยเฉพาะ 64 บิตหรือมากกว่านั้นในครั้งเดียวใน Stream Cipher แปลงได้สูงสุด 8 บิตในครั้งเดียว
3Principle (หลักการ)Block Cipher ใช้หลักการ confusion และ diffusion ทั้งคู่สำหรับการแปลงที่ต้องการในการเข้ารหัสStream Cipher ใช้หลักการ confusion เพียงอย่างเดียว
4Algorithm (อัลกอริทึม)สำหรับเข้ารหัส plain text Block Cipher ใช้ Electronic Code Book (ECB) และ Cipher Block Chaining (CBC) algorithmStream Cipher ใช้ CFB (Cipher Feedback) และ OFB (Output Feedback) algorithm
5Decryption (ถอดรหัส)เนื่องจากบิตมากกว่าถูกเข้ารหัสใน Block Cipher การถอดรหัส (reverse encryption) ซับซ้อนกว่า Stream CipherStream Cipher ใช้ XOR สำหรับเข้ารหัส ซึ่งสามารถกลับคืนเป็น plain text ได้ง่าย
6Implementation (การนำไปใช้)Implementation หลักของ Block Cipher คือ Feistel CipherImplementation หลักของ Stream Cipher คือ Vernam Cipher