hash encryption c
Which of the following is the best method for encrypting large amounts of data quickly?
A. Symmetric-key encryption
B. Hash encryption
C. Asymmetric-key encryption
D. Public-key encryption
The reasoning behind an answer to a question like this is much more complex than a simple multiple-choice answer can express.
Some hash functions (such as MD5) are extremely fast however something like XORing the data with another file would be almost as fast as reading and writing the data from the hard drive. That’s going to be the limit of how fast data can be encrypted. XORing with another file would count as a symmetric key; The other file is the key and using the same key on the encrypted data would result in the original data.
If the data doesn’t need to be very secure, answer A is the correct one because XOR is symmetric and is the fastest possible.
There are some drawbacks of XORing in this manner. The security of the encrypted data is dependent on the length of the key, the encryption key being kept secret and, if the key is significantly shorter than the original data, the original data not containing any large sections of only 0s or only 1s. In other words, making this method secure is not very practical.
Other types of symmetric-key algorithms do not have these drawbacks but they are much slower. Generally slower than hash algorithms.
If you need to make sure that this copy of the data cannot be read but you also need to prove later that you had a copy of the data then a hash algorithm is the best choice. Hashing is a one-way process. Once you have encrypted the data there is no way of getting it back again but encrypting the same data again will result in the same hash result. Most hashing algorithms are very fast. Hashing algorithms like MD5 are faster than nearly all symmetric-key algorithms and faster than any asymmetric-key algorithms that I know of.
If you don’t need to get the data back again, answer B is the correct one because hashing is the fastest secure algorithm.
Public-key encryption is a form of asymmetric-key encryption so answers C and D are essentially the same and these are well known to be slow. In most public-key implementations, (such as PGP and GPG) the data is actually encrypted with a fast symmetric-key algorithm and then the key for the data is encrypted with the asymmetric key to improve the overall throughput of the system. This confuses matters slightly because using a well known public-key encryption system may actually take the same amount of time as a symmetric-key algorithm because the bulk of the data is actually encrypted using a symmetric key.
If you needed to encrypt the data so that it couldn’t be decrypted by you but could be decrypted by someone else later, the only answer would be D: public-key encryption. In this case, the speed cannot be controlled because there is only one algorithm that fits the requirements.
I would choose answer A if this were an exam but if I was able to find out more about the requirements then I would choose either B or D depending on what the rest of the requirements were. I could probably dream up a scenario where C was the correct answer to this question but this is unlikely to happen in real life.