3DES cryptography possible bug



I seem to have found a problem with Microsoft's cryptography package
and am wondering if anyone has any additional information.

The problem specifically manifests when building an application in
Visual Studio 2005, targeting a Pocket PC 2003 Device, and running on
a Pocket PC 2003 Device. The same build on a WM5 device does not
exhibit the behavior, nor does a build targeting a Windows Mobile 5.0
Pocket PC Device, nor does a Win32 build.

The problem manifests when using MS_ENHANCED_PROV/PROV_RSA_FULL/
CALG_3DES. Encrypted strings of less than 1000 characters in length
(pre-encryption) (1000 or less, post-encryption) cannot be decrypted
successfully. The function returns ERROR_INVALID_PARAMETER. The
buffer returns with the first 8 characters decrypted, the next 8
unchanged, then garbage for the remainder (possibly overwriting
memory). The length parameter is unchanged. This happens both when
you try to decrypt the whole string in one pass and when you try to do
multiple passes of 8 characters each. It always fails on the first
pass in that second case. I believe the same modifications are made
to the buffer in both cases. Simply padding the string to a length of
1000 characters works around the problem.

.



Relevant Pages

  • Re: GPRS connection - Limited string length
    ... Helio Diamant - MS/MVP, Mobile Devices ... have a toshiba e330 with pocket pc 2002. ... > provider has give me a string for the "Extra dial-string ... > the string is 41 characters. ...
    (microsoft.public.pocketpc)
  • Re: Exception while using Triple des algorithm
    ... I have found code to encrypt / decrypt. ... When I read in a string which is 24 ... having same number of characters as that of the original string? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Decrypt problem using Rijndael
    ... The way I'm doing things right now is I'm encrypting the whole of the XML file content. ... I believe the tag delimiters are not valid Base64 characters, nor are other characters like double quote? ... I've replaced the conversion statements with Convert.From/To Base64String in both the Encrypt and Decrypt procedures as Dominick suggested. ... The safe ways to turn arbitrary binary data into a string is with something ...
    (microsoft.public.dotnet.security)
  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
    (comp.programming)