Encryption (3)
Resources |
Revision Questions |
Computer Science
Login to see all questions
Click on a question to view the answer
1.
Explain why encryption is necessary when transmitting data over a network. Your answer should discuss the potential risks to data confidentiality and integrity.
Encryption is essential for protecting data transmitted over a network because it prevents unauthorized access to the information. Without encryption, data can be intercepted by malicious actors during transmission. This interception can lead to a breach of confidentiality, where sensitive information like passwords, financial details, or personal data can be read by someone who shouldn't have access.
Furthermore, encryption can help ensure data integrity. Encryption algorithms often include mechanisms to detect if the data has been tampered with during transmission. If the data is altered, the decryption process will fail or produce incorrect results, alerting the recipient to the modification. This is crucial for preventing data corruption and ensuring the reliability of information.
Common risks without encryption include:
- Eavesdropping: An attacker intercepts the data in transit.
- Man-in-the-Middle (MITM) attacks: An attacker intercepts and potentially modifies the data exchanged between two parties.
- Data theft: Unauthorized access to stored or transmitted data.
2.
Explain how a hash function contributes to data security, and describe a scenario where it is used in conjunction with encryption.
A hash function is a one-way function that takes an input of any size and produces a fixed-size output called a hash or digest. It's designed to be computationally infeasible to reverse – meaning it's extremely difficult to determine the original input given only the hash. Hash functions are used to verify data integrity because any change to the input data will result in a completely different hash value. This allows us to detect if data has been altered during transmission or storage.
Hash functions are often used in conjunction with encryption in scenarios like password storage. Instead of storing passwords directly, systems store the hash of the password. When a user enters their password, the system hashes the entered password and compares the resulting hash with the stored hash. If the hashes match, the password is correct. This protects the actual password from being exposed if the database is compromised. Even if an attacker gains access to the database, they only obtain the hashes, not the actual passwords. While a hash is one-way, modern password storage often uses a process called salting, which adds a random string to the password before hashing. This makes it much more difficult for attackers to crack passwords using pre-computed tables of hashes (rainbow tables).
3.
Explain the difference between symmetric and asymmetric encryption. In your answer, include a description of how each method works and provide an example of a common algorithm used in each category.
Symmetric encryption uses the same key for both encryption and decryption. This means the sender and receiver must share the same secret key securely. The process involves transforming plaintext into ciphertext using the key, and then reversing the process to recover the original plaintext. A common example of a symmetric encryption algorithm is Advanced Encryption Standard (AES). AES operates on blocks of data and uses a key to perform substitution and permutation operations.
Asymmetric encryption, also known as public-key cryptography, uses a pair of keys: a public key and a private key. The public key can be freely distributed, while the private key must be kept secret. Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa. This allows for secure communication without the need for a pre-shared secret key. A common example of an asymmetric encryption algorithm is RSA (Rivest-Shamir-Adleman). RSA relies on the mathematical difficulty of factoring large numbers into prime factors.
The key difference is the key management. Symmetric encryption requires secure key exchange, while asymmetric encryption eliminates this need by using a public/private key pair.