Basic Cryptography
Basic Cryptography Notes
Introduction to Cryptography
- Cryptography: The study of secure communications, encompassing both cryptography and cryptanalysis.
- Cryptology: Study of secure communications.
- Cipher: An algorithm for encryption/decryption.
- Plain Text: Original form of a message.
- Cipher Text: Encrypted form of a message.
Importance of Encryption
- Secrecy or Confidentiality: Keeps information secret.
- Accuracy or Integrity: Encryption can protect against forgery or tampering.
- Authenticity: Digital signatures ensure authenticity in transactions.
Methods of Defense
- Software Controls:
- Internal program controls
- Operating system controls
- Development controls
- Hardware Controls:
- Firewalls
- Intrusion Detection Systems
- Effectiveness of Controls:
- Awareness of Problem
- Likelihood of Use
- Overlapping Controls
- Periodic Review
Types of Encryption
- Symmetric Encryption:
- Same key for encryption and decryption.
- Example: C = E(K, P)
- Asymmetric Encryption:
- Different keys for encryption and decryption (public/private key pair).
- Example: P = D(KD, E(KE, P))
Encryption Algorithms
- Secret Key (Symmetric System): Shared key for two users.
- Key distribution is a challenge.
- Public Key (Asymmetric System):
- Public key for encryption; private key for decryption.
- n(n-1)/2 keys needed for n users.
Cryptanalysis
- Techniques to break encryption:
- Breaking a single message.
- Recognizing patterns.
- Finding algorithm weaknesses.
Modular Arithmetic in Cryptography
- Represents letters as numbers (A=0, B=1, C=2…).
- Allows calculations with letters (e.g., A + 3 = D).
Monoalphabetic Ciphers
- Caesar Cipher:
- Each letter shifts a fixed number (e.g., +3).
- Example: TREATY -> WUHDWB.
- Advantages: Easy to perform; disadvantages: pattern is predictable.
- Substitutions:
- Each character corresponds to another character.
Permutations in Cryptography
- Scrambled alphabet for encryption.
- Provides a unique ciphertext letter for each plaintext letter.
- Example Permutation: ABCDEFGHIJKLMNOPQRSTUVWXYZ -> CBADEFGHIJKLMNOPQRSTUVWXYZ.
Polyalphabetic Ciphers
- Combines multiple monoalphabetic ciphers to improve security.
- Vigenère Cipher:
- Uses a table for encryption based on keys.
- Aims to flatten frequency distribution of letters.
Kasiski Method for Cryptanalysis
- Identifies repeated patterns in ciphertext to determine key length.
- Involves computing distances between these patterns.
Index of Coincidence
- Measures variation between letter frequencies in a ciphertext.
- Helps predict the number of substitutions used.
Perfect Substitution Cipher
- Requires non-repeating and infinite sequence for better security.
- One-Time Pads: Uses a unique key for only one use; provides ultimate secrecy but requires synchronization.
Summary of Key Concepts
- Substitutions: Monoalphabetic and Polyalphabetic Ciphers
- Transpositions: Permutations used for block ciphers.
- Vigenère Tableaux: Extends permutations to improve frequency distribution.
- One-Time Pads: Considered the most secure, but challenging to implement effectively.