ccc125l87l92l206cad32
fy53999
飞快的心情fy53999

************************使用方法****************************** 

 

Dim encBytes() As Byte = encryptAesECB(Encoding.UTF8.GetBytes(“加密数据”), Encoding.UTF8.GetBytes(key))

 

************************函数定义******************************   

 Private Function encryptAesECB(ByVal toEncryptBytes() As Byte, ByVal keyArray() As Byte)

        Dim rDel As RijndaelManaged = New RijndaelManaged
        rDel.Key = keyArray
        rDel.Mode = CipherMode.ECB
        rDel.Padding = PaddingMode.PKCS7
        Dim cTransform As ICryptoTransform = rDel.CreateEncryptor()
        encryptAesECB = cTransform.TransformFinalBlock(toEncryptBytes, 0, toEncryptBytes.Length)
    End Function

posted on 2019-11-05 23:07  fy53999  阅读(104)  评论(0编辑  收藏  举报