Dim Bconv As ByteConverter
...
Sub btnDescbc_Click
Dim data(0) As Byte
Dim key(0) As Byte
Dim iv(0) As Byte
iv = Array As Byte(11, 22, 33, 44, 55, 66, 77, 88) ' 16 bytes for AES
Dim kg As KeyGenerator
Dim c As Cipher
c.Initialize("DES/CBC/PKCS5Padding")
c.InitialisationVector = iv
kg.Initialize("DES")
kg.GenerateKey
keycode="123456789"
key= bconv.StringToBytes(keycode,"UTF8")
stringcode = "Teststring"
data = Bconv.StringToBytes(stringcode, "UTF8")
data = c.Encrypt(data, kg.Key, True)
Msgbox(Bconv.HexFromBytes(data), "Encrypted")
data = c.Decrypt(data, kg.Key, True)
Msgbox(Bconv.StringFromBytes(data, "UTF8"), "Decrypted")
End Sub