VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > VB.net教程 >
  • vb.net实现微信小程序encryptedData数据进行AES-128-CBC解密

vb.net实现微信小程序encryptedData数据进行AES-128-CBC解密,net对微信的encryptedData数据解密很方便,也只需要几行代码就进行解码了!

Dim sessionKey As String = "tiihtNczf5v6AKRyjwEUhQ==", iv As String = "r7BXXKkLb8qrSNn05n0qiA=="
Dim encryptedData As String = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="


Dim RMged As New System.Security.Cryptography.RijndaelManaged
RMged.Mode = System.Security.Cryptography.CipherMode.CBC
RMged.Padding = System.Security.Cryptography.PaddingMode.PKCS7
RMged.Key = Convert.FromBase64String(sessionKey)
RMged.IV = Convert.FromBase64String(iv)

Dim bytes() As Byte = Convert.FromBase64String(encryptedData)
Dim cTransform As System.Security.Cryptography.ICryptoTransform = RMged.CreateDecryptor()
bytes = cTransform.TransformFinalBlock(bytes, 0, bytes.Length)
Response.Write(Encoding.Default.GetString(bytes))
Response.End()


相关教程