Re: Capicom envelopeddata.decrypt failing when content > 64k

From: David Pinzon (anonymous_at_discussions.microsoft.com)
Date: 03/29/04


Date: Mon, 29 Mar 2004 06:52:19 -0800

Thanks Mitch,

I really don't mind using a customized interop assembly,
but due to the strange behavior I'm witnessing, I think
I'm going to take a look at the P/Invoke suggestion.

David

>-----Original Message-----
>Well, there was a lot of discussion about this COM
marshalling issue
>in the capicom alias. Posted solution was dis/reass the
COM iterop dll which
>i didn't like. Doable but I wanted (and some customers
too) "stalk" interop
>assemblies with no customizations!
>
>So, I opted for Pinvoke; e.g. for decrypting enveloped
data:
> http://www.jensign.com/JavaScience/dotnet/DecEnvelop
>(see CAPICOM note at bottom of that page).
>
>Cheers,
>- Mitch
>
>"David Pinz" <anonymous@discussions.microsoft.com> wrote
in message
>news:1010b01c411de$cc0afaa0$a601280a@phx.gbl...
>> Hi Mitch,
>>
>> I am using CAPICOM 2.0.0.3, and the standard
>> interop.Capicom:
>> tlbimp
>> capicom.dll /namespace:CAPICOM /out:Interop.CAPICOM.dll
>>
>> I don't know why this is happening it works fine for
sizes
>> under 64k.
>> Did you try de enveloping/deenveloping using .NET? It
>> comes to my mind that this might be another interop
issue,
>> I'll keep trying to figure this out, if you have any
other
>> suggestion i'll be glad to hear it.
>>
>> thanks
>>
>> >-----Original Message-----
>> >What version of CAPICOM?
>> >I just tried a vbs and enveloped/denveloped a bin file
>> with 1,234,111 bytes
>> >with no problems.
>> >Maybe an implemention issue in your COM interop?
>> >
>> >Cheers,
>> >- Mitch
>> >
>> >"David Pinz" <anonymous@discussions.microsoft.com>
wrote
>> in message
>> >news:12b0601c411bb$ba86f5e0$a401280a@phx.gbl...
>> >> Hi group,
>> >>
>> >> I am using C# and interop.Capicom to envelope and
>> >> deenvelope data, the enveloped data is in binary
format.
>> >> All works fine until the enveloped content reaches a
>> size
>> >> greater than 65536 bytes, when this happens the
decrypt
>> >> method fails. This happens for both even and odd
count
>> of
>> >> bytes (interop issue)
>> >>
>> >> This is the exception I'm getting:
>> >> System.Runtime.InteropServices.COMException
>> (0x80093102):
>> >> ASN1 unexpected end of data.
>> >>
>> >> at CAPICOM.EnvelopedDataClass.Decrypt(String
>> >> EnvelopedMessage)
>> >>
>> >> I am clueless about this size limit, this behavior is
>> >> happenning for both the interop.capicom and a
workaround
>> >> version of it that I am using (the binary interop
>> >> workaround)
>> >>
>> >> Any insigth would be greatly appreciated.
>> >>
>> >> Code:
>> >>
>> >> EnvMessage.Content =
>> >> System.Text.Encoding.Unicode.GetString (bytesMsg);
>> >> EnvMessage.Recipients.Add(oCert);
>> >> EnvMessage.Algorithm.Name =
>> >>
>>
CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3
>> >> DES;
>> >>
>> >> result = EnvMessage.Encrypt
>> >> (CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BINARY);
>> >>
>> >> EnvMessage.Decrypt(result)
>> >
>> >
>> >.
>> >
>
>
>.
>



Relevant Pages

  • Re: Capicom envelopeddata.decrypt failing when content > 64k
    ... Doable but I wanted (and some customers too) "stalk" interop ... e.g. for decrypting enveloped data: ... (see CAPICOM note at bottom of that page). ...
    (microsoft.public.dotnet.security)
  • Re: OT:Barkers ranting - move along nothing to see here
    ... the dole bearing in mind that I am most certainly not. ... You spend so much of your working time posting abusive messages ... to usenet groups you probably don't want your wife, customers, boss or ...
    (uk.media.tv.misc)
  • Re: Britains Got Talent - Tuesday
    ... BB threads here don't mind the numerous ... and tedious different BGT threads flooding this group. ... sky customers, bt.* groups for bt customers and so on... ... the uk hierarchy is about as bandwidth conscious ...
    (uk.media.tv.misc)
  • Re: Need advice on dealing with airlines
    ... The front line is never given the authority to do anything worth while other ... than to give the customers someone to yell at. ... transferring service to another is in their mind lost revenue. ... don't stop until you get the results you deserve. ...
    (rec.skiing.alpine)
  • Re: Google Click Fraud Settlement
    ... Could they make that a class action settlement? ... That's precisely what was going on in my mind too. ... I bet you 99% of customers have paid too much already. ...
    (alt.internet.search-engines)