Re: Rijndael class, Padding bug?, Ivan Medvedev

From: AJoshi (ajoshi@approva.net)
Date: 01/24/03


From: "AJoshi" <ajoshi@approva.net>
Date: Fri, 24 Jan 2003 17:23:46 +0530


Thanks, Ivan, Greg, George. It worked. I could find subsets that work. What
Ivan says about passing the whole encrypted thing is confirmed too.

"Ivan Medvedev [MS]" <ivanmed@online.microsoft.com> wrote in message
news:Os2L3RzwCHA.1656@TK2MSFTNGP09...
> If you do TransformFinalBlock for both encryption and decryption and don't
> set the padding (the defauld value is PKCS7 padding) everything should
work.
> One thing that many people miss is that when you use padding the encrypted
> data can be larger than the plaintext and when decrypting one needs to
make
> sure he is feeding all the encrypted data to the decryptor, not just the
> same number of bytes the plaintext had. If this still does not work for
you
> could you please post your code?
> Thanks,
> --Ivan
>
> This posting is provided "AS IS" with no warranties, and confers no rights
>
>
> "AJoshi" <ajoshi@approva.net> wrote in message
> news:e6znd24uCHA.1628@TK2MSFTNGP10...
> > Thank you, Greg. I already had a buffer with the raw data, so why go
> through
> > hoops and use a stream? BTW, TransformFinalBlock worked, but I still had
> to
> > use PaddinMode.None.
> >
> >
> > "Greg Fee" <gregfee@microsoft.com> wrote in message
> > news:OlGvD01uCHA.1848@TK2MSFTNGP09...
> > > You'll need to call TransformFinalBlock for the final block of the
> > > encryption. The streams are nice as they handle of this for you.
> > >
> > >
> > > "AJoshi" <ajoshi@approva.net> wrote in message
> > > news:#didOsvuCHA.2372@TK2MSFTNGP12...
> > > > I used code similar to the one posted by Ivan on 1/4/2003, except
that
> I
> > > > used byte[] for raw, encrypted and decrypted data. I did not use any
> > > > streams. Something very strange. I used the CreateEncryptor and
> > > > CreateDecryptor methods on the Rijndael class and used the
> > TransformBlock
> > > > methods of the returned ICryptoTransform. Encryption works fine.
> > > Decryption
> > > > works only if you set the Padding property of the Rijndael class to
> > > > Padding.None. Strange.
> > > > Thanks
> > > > A Joshi
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Auto-update protocol
    ... to transfer even with a single client and no interference. ... shared secret/public key is the only way to do the encryption. ... successfully decryption is the authentication. ... you can get using a generic farm server, but TFTP does not have any ...
    (comp.arch.embedded)
  • Re: Securing data to a process principal
    ... encryption key first time for the user - and use it later). ... secret. ... I need the decryption to ... You MAY think that instead of a filter driver you can simply ...
    (microsoft.public.platformsdk.security)
  • Re: embedded keys - there has to be a less vulnerable approach
    ... the database would be run on top of an encrypting file system ... > The use of an asymmetrical encryption algorithm does not seem to offer ... because the encryption and decryption ... > a hostile attacker is not a member of that small knowledgeable elite. ...
    (comp.security.misc)
  • embedded keys - there has to be a less vulnerable approach
    ... the database would be run on top of an encrypting file system ... The use of an asymmetrical encryption algorithm does not seem to offer ... because the encryption and decryption ... You have a table with customer names and addresses. ...
    (comp.security.misc)
  • Re: Rijndael class, Padding bug?, Ivan Medvedev
    ... If you do TransformFinalBlock for both encryption and decryption and don't ... set the padding everything should work. ...
    (microsoft.public.dotnet.security)