CryptoSys API Library Manual

Example: Pc1.Encrypt  (2)

[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)

[Contents] [Index]

[PREV: Example: Pc1.File ...]   [Contents]   [Index]   
   [NEXT: Example: Rng.Initialize ...]

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