Cryptography Flashcards
Caesar Cipher
The Caesar Cipher is a substitution cipher where each letter in the plaintext is shifted by a fixed number of positions down or up the alphabet.
Example how Ceaser Cipher works
With a shift of 3, ‘A’ becomes ‘D’, ‘B’ becomes ‘E’, and so on. ‘X’ becomes ‘A’, ‘Y’ becomes ‘B’, and ‘Z’ becomes ‘C’.
Asymmetric Encryption
Asymmetric encryption uses a pair of keys: a public key and a private key.
Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa.
For instance, when a patient uploads medical records, the system can encrypt the data using the patient’s public key, ensuring only they can decrypt it with their private key.
Symmetric Encryption
Symmetric encryption uses a single shared key for both encryption and decryption.
Both sender and receiver share the same secret key.
For instance, patient records stored in a database can be encrypted using a secret key, ensuring confidentiality and protection against unauthorized access.
HTTPS
HTTPS is a secure extension of HTTP used for transferring data over the internet.
It employs SSL/TLS protocols to encrypt data transmitted between a client and server.
For instance, when a healthcare provider accesses patient records via a web browser, HTTPS encrypts the data transmission, protecting patient privacy and confidentiality.
Cracking a Shift Cipher
Brute Force Attack:
Test all possible shift values until the correct plaintext is obtained.
Example: Trying shifts from 1 to 25 and analyzing resulting plaintext for meaningful words or patterns.
Frequency Analysis:
Analyze the frequency distribution of letters in the ciphertext to guess the shift value.
Example: Identifying the most frequent letter in the ciphertext and assuming it corresponds to ‘E’ in the plaintext.
Vigenère Cipher Encryption
- Repeat the key until it matches the length of the message.
- Convert message and key to numeric representations.
- Add message values to key values modulo 26.
- Convert resulting values back to alphabetic representation.
Vigenère Cipher Decryption
- Repeat the key until it matches the length of the encrypted message.
- Convert encrypted message and key to numeric representations.
- Subtract encrypted message values by key values modulo 26.
- Convert resulting values back to alphabetic representation.
What type of encryption to encrypt the passwords prior to storage
Symmetric encryption is preferred for encrypting passwords prior to storage due to its efficiency, performance, and simplified key management, provided that proper security measures are in place for managing encryption keys.
Caesar Cipher vs. Kid-RSA
Encryption Method:
Caesar Cipher: Substitution cipher.
Kid-RSA: Asymmetric encryption.
Security:
Caesar Cipher: Low security, easily breakable.
Kid-RSA: High security, relies on computational complexity.
Key Generation:
Caesar Cipher: Fixed shift value.
Kid-RSA: Key pair generated - public and private keys.
Key Management:
Caesar Cipher: Simple, single key.
Kid-RSA: Requires secure management of public and private keys.
Why does Kid-RSA win over Caesar Cipher
Security Strength:
Kid-RSA: Offers higher security due to computational complexity.
Caesar Cipher: Low security, easily breakable.
Key Management:
Kid-RSA: Requires robust key management for key pairs.
Caesar Cipher: Simple key management with fixed shift value.
Private Key vs. Public Key
Private Key: Decrypts, signs, secret.
Public Key: Encrypts, verifies, shared.
Authentication with Private and Public Keys
Authentication is achieved without the need for shared secrets or passwords, providing a robust mechanism for secure communications.
Private Key: Secretly generated by each user, Used to create a digital signature for messages/documents.
Public Key: Corresponding key freely distributed, Not involved in signature creation.