[VB6 equivalent: TDEA_HexMode
]
Dim sOutput As String
Dim sInput As String
Dim sKey As String
Dim sInitV As String
Dim sCorrect As String
sInput = "5468697320736F6D652073616D706520636F6E74656E742E0808080808080808"
' T h i s _ s o m e _ s a m p e _ c o n t e n t . (padding 8 x 08)
sKey = "737C791F25EAD0E04629254352F7DC6291E5CB26917ADA32"
sInitV = "B36B6BFB6231084E"
sCorrect = "d76fd1178fbd02f84231f5c1d2a2f74a4159482964f675248254223daf9af8e4"
Console.WriteLine("KY=" & sKey)
Console.WriteLine("PT=" & sInput)
sOutput = Tdea.Encrypt(sInput, sKey, Mode.CBC, sInitV, EncodingBase.Base16)
Console.WriteLine("CT=" & sOutput & " " & General.ErrorCode)
Console.WriteLine("OK=" & sCorrect)
sInput = sOutput
sOutput = Tdea.Decrypt(sInput, sKey, Mode.CBC, sInitV, EncodingBase.Base16)
Console.WriteLine("P'=" & sOutput & " " & General.ErrorCode)
See Also:
Tdea.Decrypt Method (String, String, Mode, String)
Tdea.Encrypt Method (String, String, Mode, String)