Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Advanced Encryption Algorithm is not working

$
0
0

       

RijndaelManaged myAes =newRijndaelManaged();

        myAes.GenerateIV();

myAes.GenerateKey();

       

if (file !=null)

        {

           

ICryptoTransform encryption = myAes.CreateEncryptor(myAes.Key, myAes.IV);

           

MemoryStream stream =newMemoryStream();

           

CryptoStream crystream =newCryptoStream(stream, encryption,CryptoStreamMode.Write);

           

StreamWriter write =newStreamWriter(crystream);

            write.Write(file);

            encrypt = stream.ToArray();

           

        }

It is not  encrypting any data in file, but the file get empty


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>