Attribute VB_Name = "Chain3Des"

'============== ENCRYPTION ALGORITHM Constants ================
Global Const ALGO_DES = 0
Global Const ALGO_3DES = 1
Global Const ALGO_XOR = 3
Global Const DATA_ENCRYPT = 1
Global Const DATA_DECRYPT = 2


'Note : Block is equal to 8 bytes. So to encrypt/decrypt 8 bytes of data
'       user must use 1 block in the parameter.
'       Example:
'        'This code encrypts 8 bytes of data!
'        Dim Data(1 to 8) as byte ' Assume data was entered
'        Dim Key(1 to 8) as byte ' Assume key already exits
'        Chain_DES(Data(1), Key(1), ALGO_3DES , 1 ,DATA_ENCRYPT)
'
'=========================================================================
'       CHAIN_DES PROTOTYPE
'=========================================================================
Declare Function Chain_DES Lib "chaindes.dll" (ByRef Data As Any, ByRef key As Any, ByVal TripleDES As Integer, ByVal Blocks As Long, ByVal method As Long) As Long
Declare Function Chain_MAC Lib "chaindes.dll" (ByRef mac As Any, ByRef Data As Any, ByRef key As Any, ByVal Blocks As Long) As Long
Declare Function Chain_MAC2 Lib "chaindes.dll" (ByRef mac As Any, ByRef Data As Any, ByRef key As Any, ByVal Blocks As Long) As Long

