Imports System.Security.Cryptography
Public Function Encryption(ByVal data() As Byte, ByVal MyKey As String) As Int32
Dim _key() As Byte = Convert.FromBase64String(MyKey)
Dim _iv() As Byte = {83, 71, 26, 58, 54, 35, 22, 11, 83, 71, 26, 58, 54, 35, 22, 11}
Dim keyBuilder As Rfc2898DeriveBytes = New Rfc2898DeriveBytes(MyKey, _iv)
Dim ms As New MemoryStream()
Dim aes As New RijndaelManaged()
aes.IV = keyBuilder.GetBytes(CType(aes.BlockSize / 8, Integer))
aes.Key = keyBuilder.GetBytes(CType(aes.KeySize / 8, Integer))
Dim cs As New CryptoStream(ms, aes.CreateEncryptor, CryptoStreamMode.Write)
cs.Write(data, 0, data.Length)
Console.WriteLine(Convert.ToBase64String(ms.GetBuffer()))
Console.WriteLine("Hello World")
Encryption(Encoding.ASCII.GetBytes("19840622"),"ntr5QHujLcpbE64rUDcLtVY7zfFA5aWgFXorDCV3fA1AIk3PU1DQaRsvyQoj6nGT")