Encrypting byte array

From: Etienne Charland (mystery@golden.net)
Date: 03/25/03


From: "Etienne Charland" <mystery@golden.net>
Date: Tue, 25 Mar 2003 16:21:07 -0500


I need a function that encrypts (another one to decrypt) a byte array, and
returns the encrypted byte array. I've done it using CryptoStream, but this
gives very poor performances since I convert the bytes into a stream,
encrypt with CryptoStream (wich converts to byte arrays internally), and
then convert the result stream into a byte array. Have anyone done such a
function that works directly with ICryptoTransform to convert blocks of
data? If yes, could I have a link? If not, I have another question. Since
block sizes are fixed (16 bytes for Rijndael), how do I know the length of
the data during decryption? When encrypting, I have to add padding, but
then, on decryption, I don't know what is the data and what is the
padding...

Thank you very much for your help

Etienne



Relevant Pages

  • Re: Encrypting byte array
    ... > I need a function that encrypts a byte array, ... > returns the encrypted byte array. ... > block sizes are fixed, how do I know the length of ... > then, on decryption, I don't know what is the data and what is the ...
    (microsoft.public.dotnet.security)
  • Re: Encrypting byte array
    ... Etienne, ... When you call the decryption routine, ... > I need a function that encrypts a byte array, ... > returns the encrypted byte array. ...
    (microsoft.public.dotnet.security)
  • Re: About padding with files in AES
    ... the system which encrypts and the system which decrypts. ... padding can be ... A block cipher such as AES ... "Upon decryption, the decrypting system just needs to look at ...
    (sci.crypt)
  • Re: RijndaelManaged decryption leaves strange characters
    ... > only include the number of actually decrypted bytes, not the whole array. ... > same size as encrypted array, but when the decryption is done and you know ... >> characters disappear and don't return when you leave the cell. ...
    (microsoft.public.dotnet.security)
  • RSA encrypt/decrypt of byte array
    ... I'm encrypting and then decrypting a byte array using the ... The byte array is 52 bytes in length. ... I then pass this string along to the decryption function. ...
    (microsoft.public.dotnet.security)