Re: CryptEncrypt fails on pocket pc (c#)
From: Anatoly (wiretransfers_at_yahoo.com)
Date: 10/26/03
- Previous message: Pieter Philippaerts: "Re: CryptEncrypt fails on pocket pc (c#)"
- In reply to: Pieter Philippaerts: "Re: CryptEncrypt fails on pocket pc (c#)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 25 Oct 2003 20:18:08 -0400
I replaced the signature as you suggested, and provided value of 1 instead
of "True"
The CALG_RC4 encryption call worked!!,
but when I replace the CALG_RC4 with CALG_RSA_KEYX or CALG_RSA_SIGN, the
encryption fails,
isn't this encryption also supported on pocket pc?
-Anatoly
"Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
news:udxM6O1mDHA.2416@TK2MSFTNGP10.phx.gbl...
> "Anatoly" <wiretransfers@yahoo.com> wrote in message
> > I am testing out some encryption on pocket pc with C#.net, (see below
> code)
> > it executes through Generating the key, but fails when trying to
actually
> > encrypt data with it.
>
> Your definition of CryptEncrypt is wrong. Try this:
>
> [DllImport(CryptDll)]
> public static extern bool CryptEncrypt(IntPtr hKey, IntPtr hHash, int
Final,
> uint dwFlags, byte[] pbData, ref uint pdwDataLen, uint dwBufLen);
>
> There's a difference between 'bool' and 'BOOL' in C. Like in C#, bool is a
> 1-byte variable and BOOL is a 4-byte variable. The CryptEncrypt uses the
> 4-byte type and you declared it as a 1-byte type. This corrupts the
> parameters on the stack, and hence the error.
>
> Regards,
> Pieter Philippaerts
> Managed SSL/TLS: http://www.mentalis.org/go.php?sl
>
>
- Previous message: Pieter Philippaerts: "Re: CryptEncrypt fails on pocket pc (c#)"
- In reply to: Pieter Philippaerts: "Re: CryptEncrypt fails on pocket pc (c#)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|