RC4 ( Rivest Cipher 4 )

 Symmetric-Key Algorithms 

Symmetric-key algorithms use the same key to lock (encrypt) and unlock (decrypt) a message.

Types of Symmetric-Key Algorithms:

  • Stream Cipher: Changes the message into secret code one byte at a time.

  • Block Cipher: Changes the message into secret code one block at a time (a block is a group of bytes).


Block Cipher vs Stream Cipher 

Block Cipher:

  • Encrypts a block of text at a time (usually 64 bits or more).

  • Simple design and logic.

  • Hard to reverse (decrypt) without the key.

  • Slower than stream cipher.

  • Example: AES.

Stream Cipher:

  • Encrypts one byte at a time (usually 8 bits).

  • More complex design.

  • Easier to reverse (decrypt) if weakly protected.

  • Faster than block cipher.

  • Famous example: Vernam Cipher.





RC4 (Rivest Cipher 4)

  • Created by Ron Rivest in 1987 for RSA Security.

  • RC4 is a stream cipher, known for being fast and simple.

  • It uses a variable key size (usually 64-bit or 128-bit).

  • Works with bytes, not blocks.

  • Commonly used in:

    • SSL (Secure Socket Layer)

    • TLS (Transport Layer Security)

    • Wi-Fi (IEEE 802.11)

How does it work

  • Initialize an array of 256 bytes.

  • Run the Key Scheduling Algorithm (KSA) on it.

  • Run the Pseudo-Random Generation Algorithm (PRGA) on the KSA output to generate a key stream.

  • XOR the data with the key stream.

Comments

Popular posts from this blog

PDC syllabus

4) What Jeff Bezos Wishes He Knew Before Starting Amazon – Investing Tips for 2024

3) Mark Cuban’s Advice on Building Wealth Fast and What You’re Doing Wrong