CryptoSys API Library Manual

Example: Aes128.ErrCode  Aes128.InitEncrypt  Aes128.Instance 

[VB6 equivalent: AES128_InitError]

Dim nRet As Integer
Dim oAes128 As Aes128 = Aes128.Instance()

' Try to initialise with an invalid key
nRet = oAes128.InitEncrypt("THIS IS NOT HEX!", Mode.CBC, "0123456789abcdef0123456789abcdef")
If nRet <> 0 Then
    Console.WriteLine("Aes128.InitHex failed (" & General.ErrorLookup(oAes128.ErrCode) & ")")
End If

' Try with an invalid mode
' <This cannot happen with the .NET method>

See Also:
Aes128.ErrCode Property

[Contents] [Index]

[PREV: Example: Aes128.Decrypt ...]   [Contents]   [Index]   
   [NEXT: Example: Aes128.Dispose ...]

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