You are developing a method to hash data with the Secure Hash Algorithm. The data is passed
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?
A. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash = nullptr;sha-
>TransformBlock(message, 0, message->Length, hash, 0);
B. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash =
BitConverter::GetBytes(sha->GetHashCode());
C. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash = sha-
>ComputeHash(message);
D. SHA1 ^sha = gcnew
SHA1CryptoServiceProvider();sha->GetHashCode();array<Byte>^hash = sha->Hash;
Answer: C
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?
A. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash = nullptr;sha-
>TransformBlock(message, 0, message->Length, hash, 0);
B. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash =
BitConverter::GetBytes(sha->GetHashCode());
C. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array<Byte>^hash = sha-
>ComputeHash(message);
D. SHA1 ^sha = gcnew
SHA1CryptoServiceProvider();sha->GetHashCode();array<Byte>^hash = sha->Hash;
Answer: C
No comments:
Post a Comment