Я пробую что -то подобное < /p>
Код: Выделить всё
Imports System.Security.Cryptography
Imports System.Text
Imports System.IO
Public Class CryptographyHelper
Public Property ClientPrivateKey As String = "1234567890123456" ' 16 chars for AES-128
Public Function Encrypt(input As String) As String
Dim keyBytes As Byte() = Encoding.UTF8.GetBytes(ClientPrivateKey)
Dim aes As Aes = Aes.Create()
aes.Key = keyBytes
aes.Mode = CipherMode.CBC
aes.Padding = PaddingMode.PKCS7
' Generate a random IV
aes.GenerateIV()
Dim iv As Byte() = aes.IV
Dim encryptor As ICryptoTransform = aes.CreateEncryptor()
Dim inputBytes As Byte() = Encoding.UTF8.GetBytes(input)
Dim encryptedBytes As Byte() = encryptor.TransformFinalBlock(inputBytes, 0, inputBytes.Length)
' Combine IV + encryptedBytes
Dim resultBytes As Byte() = iv.Concat(encryptedBytes).ToArray()
Return Convert.ToBase64String(resultBytes)
End Function
End Class
< /code>
И я использую следующее < /p>
=Code.Base64Encode(Fields!CustomerNumber.Value & "|" & Fields!DocumentNumber.Value)
Подробнее здесь: https://stackoverflow.com/questions/795 ... ypted-text