[Day 3] 2. Encryption Methods
Here’s a corrected and clarified version of the information:
Types of Encryption
There are two primary types of encryption techniques:
1. Substitution Cipher
In a substitution cipher, each character in the plaintext is replaced by another character based on a specific rule.
Example:
Plaintext: ABCDEFGHIJKLMNOPQRSTUVWXYZ Ciphertext: ZYXWVUTSRQPONMLKJIHGFEDCBA
There are two main types of substitution ciphers:
-
Mono-alphabetic Substitution Cipher:
Each character is replaced by a single, unique character using a fixed substitution rule.
Examples:- Atbash Cipher: Reverses the alphabet (as in the example above).
- Caesar Cipher: Shifts each character by a fixed number of places in the alphabet (e.g., shifting "A" by 3 becomes "D").
-
Poly-alphabetic Substitution Cipher:
Uses multiple substitution alphabets, meaning the same plaintext letter may be encoded differently depending on its position or a key.
Examples:- Vigenère Cipher: A key is repeated to determine which alphabet is used to encrypt each letter. For example, with the plaintext "HELLO" and the key "KEY", the key repeats as "KEYKE" to encode the message.
- Homophonic Substitution Cipher: Each plaintext character can be substituted by multiple possible symbols or numbers, reducing predictability. For example, "A" could map to "1," "17," or "99," but no symbol or number should always map to the same plaintext character.
2. Transposition Cipher
In a transposition cipher, the characters of the plaintext are rearranged in a specific pattern or order without altering the characters themselves.
Example: For the plaintext "HELLO", using a simple columnar transposition with 3 columns:
Plaintext: H E L L O Arranged: H L E L O (rearrange by reading vertically) Ciphertext: HLELO
No new characters are introduced; the original characters are merely shuffled to form the ciphertext.
Key Differences Between Substitution and Transposition Ciphers
|Feature|Substitution Cipher|Transposition Cipher| |---|---|---| |Operation|Replaces characters with other characters|Rearranges the order of characters| |Character Integrity|Characters may be altered (e.g., A → D)|Original characters remain unchanged| |Examples|Atbash, Caesar, Vigenère|Columnar Transposition, Rail Fence|
Read Next
[Day 3] 3. Encryption Schemes
#### **Symmetric Algorithms** - **Definition:** In symmetric encryption, both the sender and receiver use the **same key** for both encrypti...
[Day 3] 4. Monitoring Health of a Machine
The goal is to **monitor the health** of a machine and send the collected statistics to another server. The key parameters to monitor include: - **...