[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: Additional: DES Crypto,what is being used as padding for
From:       Guy Dumais <guy_dumais () SILANIS ! COM>
Date:       1999-06-30 14:30:34
[Download RAW message or body]


One place to look is RSA PKCS #5.

> -----Original Message-----
> From: Microsoft Cryptographic API
> [mailto:CryptoAPI@DISCUSS.MICROSOFT.COM]On Behalf Of Graham Phillips
> Sent: Wednesday, June 30, 1999 9:43 AM
> To: CryptoAPI@DISCUSS.MICROSOFT.COM
> Subject: Re: Additional: DES Crypto,what is being used as padding for
> non-8 b yte aligned strings?
>
>
> Data for block ciphers must always be padded, even if the
> data length happens
> to be an integral multiple of the block length, because
> otherwise there would
> be no way of telling (later) what was original data and what
> was padding. The
> normal method (for 64-bit block ciphers) is to add 1 to 8
> padding bytes; the
> content of every padding byte is the number of padding bytes.
> So for example
> if the original data was five bytes long, the padded block
> would be the five
> data bytes followed by three bytes each having the value 3.
> To reconstruct the
> original data, start at the end and strip off the number of
> bytes indicated in
> the last byte.
>
> If the original data was 8 bytes long, then a further eight
> bytes containing
> the value 8 would be appended. If this were not done, and
> (for example) the
> last data byte happened to be 1, then in the reconstruction
> stage the last
> byte would get erroneously stripped.
>
> I believe there is a standard for this, but I'm not sure what it is.
>
> "Ivo Salmre (Exchange)" wrote:
> > Q3: What am I to make of this?  (a) Is it a bug in the CAPI
> provide that it
> > returns an error code?  (b) Is this expected behavior?  (c)
> Is it reasonable
> > to expect this behavior to stay 'as is'?
>
> so:
> (a) no
> (b) yes
> (c) yes.
>
> --
> Graham Phillips
> Clinical and Biomedical Computing Unit
> University of Cambridge Clinical School
> Box 111, Addenbrooke's Hospital
> Hills Road, Cambridge CB2 2SP, UK
>
> +44 (0)1223 400064
> http://www.cbcu.cam.ac.uk

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic