how to decrypt file asynchronously and convert it into bytes in C#
<p>is it possible to decrypt file asynchronously and transform it into bytes ?
the bytes data will be converted into another object like image or something else.</p>

<p>so, I want to decypt file without having to save it into real file, for example:</p>

<p>I encrypted an image and I want to decrypt it without saving into real file, in this case the decrypted file is an image.</p>

<p>so the best way to do this from my opinion is to read the bytes from the encrypted file asynchronously and convert the bytes into an image.</p>

<p>I need a clue guys, even without code examples, I appreciate it. thanks.</p>

<p>I encrypted the file using this basic code from msdn:</p>

<pre><code> private static void encrypt(string fileInput,
                                string fileOutput,
                                string key)
    {
        FileStream fInput = new FileStream(fileInput, FileMode.Open, FileAccess.Read);
        FileStream fOutput = new FileStream(fileOutput, FileMode.Create, FileAccess.Write);
        DESCryptoServiceProvider des = new DESCryptoServiceProvider();
        des.Key = ASCIIEncoding.ASCII.GetBytes(password);
        des.IV = ASCIIEncoding.ASCII.GetBytes(password);

        ICryptoTransform encryptor = des.CreateEncryptor();
        CryptoStream cryptostream = new CryptoStream(fOutput, encryptor, CryptoStreamMode.Write);

        Byte[] byteArrayInput = new byte[fInput.Length];
        fInput.ReadAsync(byteArrayInput, 0, byteArrayInput.Length);
        cryptostream.WriteAsync(byteArrayInput, 0, byteArrayInput.Length);
        cryptostream.Close();
        fInput.Close();
        fOutput.Close();
        des.Dispose();
    }
</code></pre>