CryptoSys API Library Manual

Example: Blowfish.Decrypt  Blowfish.Encrypt  (4)

[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"
' Set strOutput to be same length as strInput

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)

[Contents] [Index]

[PREV: Example: Blowfish.FileEncrypt ...]   [Contents]   [Index]   
   [NEXT: Example: Blowfish.Decrypt ...]

Copyright © 2001-23 D.I. Management Services Pty Ltd. All rights reserved. Generated 2023-05-20T13:01:10Z.