[VB6 equivalent: PC1_Hex]
Dim strKey As String Dim strInput As String Dim strOutput As String Dim strCorrect As String Dim strCheck As String ' Test vector 3 strKey = "ef012345" strInput = "00000000000000000000" strCorrect = "d6a141a7ec3c38dfbd61" Console.WriteLine("KY=" & " " & strKey) Console.WriteLine("PT=" & " " & strInput) ' Encipher using PC1 in hex mode strOutput = Pc1.Encrypt(strInput, strKey) Console.WriteLine("CT=" & " " & strOutput) Console.WriteLine("OK=" & " " & strCorrect) ' Now decipher just by calling again. strCheck = Pc1.Encrypt(strOutput, strKey) Console.WriteLine("P'=" & " " & strCheck)
See Also:
Pc1.Encrypt Method (String, String)