You are developing a method to decrypt data that was encrypted with the Triple DES Algorithm.
The method accepts the following parameters: The byte array to be decrypted, which is named
cipherMessageThe key, which is named keyAn initialization vector, which is named iv You need
to decrypt the message by using the TripleDES class and place the result in a string.
Which code segment should you use?
A. Dim objDES As New TripleDESCryptoServiceProviderobjDES.BlockSize =
cipherMessage.LengthDim objCrypto As ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
B. Dim objDES As New TripleDESCryptoServiceProviderobjDES.FeedbackSize =
cipherMessage.LengthDim objCrypto As ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
C. Dim objDES As New TripleDESCryptoServiceProviderDim objCrypto As
ICryptoTransform = _
objDES.CreateDecryptor()Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
D. Dim objDES As New TripleDESCryptoServiceProviderDim objCrypto As
ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
Answer: D
The method accepts the following parameters: The byte array to be decrypted, which is named
cipherMessageThe key, which is named keyAn initialization vector, which is named iv You need
to decrypt the message by using the TripleDES class and place the result in a string.
Which code segment should you use?
A. Dim objDES As New TripleDESCryptoServiceProviderobjDES.BlockSize =
cipherMessage.LengthDim objCrypto As ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
B. Dim objDES As New TripleDESCryptoServiceProviderobjDES.FeedbackSize =
cipherMessage.LengthDim objCrypto As ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
C. Dim objDES As New TripleDESCryptoServiceProviderDim objCrypto As
ICryptoTransform = _
objDES.CreateDecryptor()Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
D. Dim objDES As New TripleDESCryptoServiceProviderDim objCrypto As
ICryptoTransform = _
objDES.CreateDecryptor(key, iv)Dim cipherStream As New
MemoryStream(cipherMessage)Dim cryptoStream As New CryptoStream( _
cipherStream, objCrypto, CryptoStreamMode.Read)Dim message As Stringmessage =
New StreamReader(cryptoStream).ReadToEnd
Answer: D
No comments:
Post a Comment