Programming in C# — Question 157
You are developing an application that will transmit large amounts of data between a client computer and a server.
You need to ensure the validity of the data by using a cryptographic hashing algorithm.
Which algorithm should you use?
Answer options
- A. DES
- B. HMACSHA512
- C. RNGCryptoServiceProvider
- D. ECDsa
Correct answer: B
Explanation
HMACSHA512 is a hashing algorithm that combines a cryptographic hash function with a secret key, making it suitable for data integrity verification. DES is a symmetric-key algorithm primarily used for encryption, while RNGCryptoServiceProvider is for generating random numbers, and ECDsa is used for digital signatures rather than hashing.