از دوستان بخاطر توجه شما به موضوع این تاپیک سپاسگزارم ولی Dencrytion در کمبوباکس کماکان بی نتیجه بود
نمونه ای نزدیک به کدی که من استفاده میکنم برای Encription And Dencryption
Private Function Encrypt(ByVal clearText As String) As String
Dim EncryptionKey As String ="MAKV2SPBNI99212"
Dim clearBytes() As Byte = Encoding.Unicode.GetBytes(clearText)
Using encryptor As Aes = Aes.Create()
Dim pdb As New Rfc2898DeriveBytes(EncryptionKey,New Byte() { &H49, &H76, &H61, &H6e, &H20, &H4d, &H65, &H64, &H76, &H65, &H64, &H65, &H76 })
encryptor.Key = pdb.GetBytes(32)
encryptor.IV = pdb.GetBytes(16)
Using ms As New MemoryStream()
Using cs As New CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write)
cs.Write(clearBytes, 0, clearBytes.Length)
cs.Close()
End Using
clearText = Convert.ToBase64String(ms.ToArray())
End Using
End Using
Return clearText
End Function
Private Function Decrypt(ByVal cipherText As String) As String
Dim EncryptionKey As String ="MAKV2SPBNI99212"
Dim cipherBytes() As Byte = Convert.FromBase64String(cipherText)
Using encryptor As Aes = Aes.Create()
Dim pdb As New Rfc2898DeriveBytes(EncryptionKey,New Byte() { &H49, &H76, &H61, &H6e, &H20, &H4d, &H65, &H64, &H76, &H65, &H64, &H65, &H76 })
encryptor.Key = pdb.GetBytes(32)
encryptor.IV = pdb.GetBytes(16)
Using ms As New MemoryStream()
Using cs As New CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write)
cs.Write(cipherBytes, 0, cipherBytes.Length)
cs.Close()
End Using
cipherText = Encoding.Unicode.GetString(ms.ToArray())
End Using
End Using
Return cipherText
End Function