Question: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 cipherMessage
The key, which is named key
An 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 TripleDES des = new TripleDESCryptoServiceProvider(); ICryptoTransform crypto = des.
CreateDecryptor();
MemoryStream cipherStream = new MemoryStream(cipherMessage); CryptoStream cryptoStream = new CryptoStream(
cipherStream, crypto, CryptoStreamMode.Read);
string message;
message = new StreamReader(cryptoStream).ReadToEnd(); 

B TripleDES des = new TripleDESCryptoServiceProvider(); ICryptoTransform crypto = des. CreateDecryptor(key, iv); MemoryStream cipherStream = new MemoryStream(cipherMessage);CryptoStream cryptoStream =
new CryptoStream(
cipherStream, crypto, CryptoStreamMode.Read);
string message;
message = new StreamReader(cryptoStream).ReadToEnd(); 

C TripleDES des = new TripleDESCryptoServiceProvider();
des.BlockSize = cipherMessage.Length;
ICryptoTransform crypto = des.CreateDecryptor(key, iv);
MemoryStream cipherStream = new MemoryStream(cipherMessage); CryptoStream cryptoStream = new CryptoStream(
cipherStream, crypto, CryptoStreamMode.Read);
string message;
message = new StreamReader(cryptoStream).ReadToEnd(); "A Composite Solution With Just One
Click" - Certification Guaranteed 297 Microsoft 70-536 Exam 

D TripleDES des = new TripleDESCryptoServiceProvider();
des.FeedbackSize = cipherMessage.Length;
ICryptoTransform crypto = des.CreateDecryptor(key, iv);
MemoryStream cipherStream = new MemoryStream(cipherMessage); CryptoStream cryptoStream =
new CryptoStream(
cipherStream, crypto, CryptoStreamMode.Read);
string message;
message = new StreamReader(cryptoStream).ReadToEnd(); 

+ Answer
+ Report
Total Preview: 1139

Copyright © 2024. Powered by Intellect Software Ltd