Question: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 Dim objSHA As New SHA1CryptoServiceProvider
Dim hash() As Byte = objSHA.ComputeHash(message) 

B Dim objSHA As New SHA1CryptoServiceProvider
Dim hash() As Byte = Nothing
objSHA.TransformBlock(message, 0, message.Length, hash, 0) 

C Dim objSHA As New SHA1CryptoServiceProvider
Dim hash() As Byte = BitConverter.GetBytes(objSHA.GetHashCode) 

D Dim objSHA As New SHA1CryptoServiceProvider
objSHA.GetHashCode()
Dim hash() As Byte = objSHA.Hash 

+ Answer
+ Report
Total Preview: 1003

Copyright © 2024. Powered by Intellect Software Ltd