How do I encrypt a string in vb.net using RijndaelManaged, and using PKCS5 padding?

后端 未结 2 905
名媛妹妹
名媛妹妹 2020-12-11 21:11

I use the following code to initialize encryption...

 Dim symmetricKey As New System.Security.Cryptography.RijndaelManaged()
 With symmetricKey
   .Key = Enc         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 21:27

    PKCS7 padding and PKCS5 padding are the same thing. In this context they are synonyms.

    EDIT:

    The PKCS#7 padding is described in the PKCS#7 spec in section 10.3. PKCS#5 padding is described in the PKCS#5 spec in section 6.1.1 step 4. As you can see by examination, the padding algorithms are identical.

提交回复
热议问题