Câu hỏi phỏng vấn Cryptography
Câu hỏi

What is the difference Between Block Cipher and Stream Cipher?

Câu trả lời

The difference between block ciphers and stream ciphers lies in how they process and encrypt data. Here is a detailed comparison:

Block Cipher

Definition

A block cipher is a symmetric-key encryption method that processes fixed-length groups of bits, called blocks, into encrypted ciphertext blocks of the same length[4][7].

Operation

  • Process: Encrypts data in fixed-size blocks (e.g., 64 bits, 128 bits, or 256 bits)[4][7].
  • Encryption: Each block of plaintext is encrypted independently using a key and a cryptographic algorithm[4][7].
  • Decryption: The decryption algorithm is the inverse of the encryption algorithm, allowing the original plaintext to be recovered from the ciphertext[4][7].

Characteristics

  • Speed: Generally slower than stream ciphers due to the processing of large blocks of data[1][2][3].
  • Security: Typically more secure than stream ciphers, especially when using strong encryption modes and key management practices[2][3][4].
  • Modes of Operation: Includes ECB (Electronic Code Book), CBC (Cipher Block Chaining), CFB (Cipher Feedback), OFB (Output Feedback), and CTR (Counter)[1][2][10].
  • Examples: AES (Advanced Encryption Standard), DES (Data Encryption Standard), Blowfish[4][7][18].

Use Cases

  • Suitable for applications that handle large amounts of data, such as file transmission, email, and database encryption[2][3][4].

Stream Cipher

Definition

A stream cipher is a symmetric-key encryption method that encrypts data one bit or byte at a time, using a pseudorandom keystream generated from a key[5][6][8].

Operation

  • Process: Encrypts data bit-by-bit or byte-by-byte[1][2][5].
  • Encryption: Each bit or byte of plaintext is encrypted individually by XORing it with a bit or byte from the keystream[1][5][6].
  • Decryption: The ciphertext is decrypted by XORing it with the same keystream used for encryption[5][6][8].

Characteristics

  • Speed: Generally faster than block ciphers due to the bit-by-bit or byte-by-byte processing[1][2][3].
  • Security: Can be less secure than block ciphers if the keystream is not properly managed or if the same keystream is reused[2][3][5].
  • Types: Includes synchronous stream ciphers (keystream generated independently of plaintext/ciphertext) and self-synchronizing stream ciphers (keystream depends on previous ciphertext bits)[5][8][14].
  • Examples: RC4, Salsa20, ChaCha20[6][8][14].

Use Cases

  • Suitable for applications requiring real-time encryption, such as video streaming, online gaming, and secure internet communications[2][3][6].

Su...

middle

middle

Gợi ý câu hỏi phỏng vấn

expert

What is a Salt and How Does It Make Password Hashing More Secure?

middle

Provide an example of non-reciprocal cipher

entry

Explain what is Data Encryption?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào