asp.net - Avoid "==" in Encrypting string -


Below is my code every time when I encrypt the string, it is giving the string "==" at the end is.

How can I avoid it

  encrypt the private function (as a clear string) String dim EncryptionKey string = "MAKV2SPBNI99212" as the dim clearBytes byte In the form of () = Encoding.Unicode.GetBytes (Clear) using as encryptor AES = AES. H49, & amp;, H76, & amp; H61, & amp; H6E, & amp; H20, & amp; H4D, _ & amp; H65, & amp; (H64, & H76, & H65, & amp; H64, & amp; H65, _ & H76} to make slow pdb new Rfc2898DeriveBytes (EncryptionKey, New byte () & amp; ) Encryptor.Key = pdb.GetBytes (32) encryptor.IV = pdb.GetBytes (16) New MemoryStream () Using MS as the new CryptoStream (MS, encryptor.CreateEncryptor (), CryptoStreamMode.Write) Cs.Write (clearBytes, 0, clearBytes.Length) cs.Close () use the other end from the end clear = Convert.ToBase64String (ms.ToArray ()) use the clear text as the end use    

The result is just this Ngit is that the length of the input byte array is not a 3, and required to decode the correct string. It's not a matter of concern, and this is not an indication that there is anything wrong with your encryption algorithm.

You really need to stop it, make sure the byte array passes you to ToBase64String , possibly not array padding with the zeros (but then you do not have string decoding Do not want to be able to close those zero bars) that is a multi-length of 3 by that.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -