[VB6 equivalent: BLF_Hex]
Dim strOutput As String
Dim strInput As String
Dim strKey As String
Dim sCorrect As String
strInput = "0123456789ABCDEF"
strKey = "FEDCBA9876543210"
sCorrect = "0ACEAB0FC6A0A28D"
Console.WriteLine("KY=" & " " & strKey)
Console.WriteLine("PT=" & " " & strInput)
' Encrypt in one-off process
strOutput = Blowfish.Encrypt(strInput, strKey, Mode.ECB, Nothing)
Console.WriteLine("CT=" & " " & strOutput)
Console.WriteLine("OK=" & " " & sCorrect)
' Now decrypt back to plain text
strInput = strOutput
strOutput = Blowfish.Decrypt(strInput, strKey, Mode.ECB, Nothing)
Console.WriteLine("P'=" & " " & strOutput)
See Also:
Blowfish.Decrypt Method (String, String, Mode, String)
Blowfish.Encrypt Method (String, String, Mode, String)