Re: CryptEncrypt fails on pocket pc (c#)

From: Anatoly (wiretransfers_at_yahoo.com)
Date: 10/26/03

  • Next message: Anatoly: "CryptExport private key only"
    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
    >
    >


  • Next message: Anatoly: "CryptExport private key only"

    Relevant Pages

    • Re: CryptEncrypt fails on pocketpc
      ... I replaced the signature as you suggested, and provided value of 1 instead ... The CALG_RC4 encryption call worked!!, ... > public static extern bool CryptEncrypt(IntPtr hKey, IntPtr hHash, int ...
      (microsoft.public.platformsdk.security)
    • Re: RSA breaking vs. factoring
      ... affects the two possible usages of RSA both for encryption (first public, ... then private key) and for signing ... are identical to encryption, in reverse order. ... Digital signature generation takes an input message (which may be quite ...
      (sci.crypt)
    • RE: Signing before Encryption and Signing after Encryption
      ... I don't understand how a signature can work with a shared key. ... Signing before Encryption and Signing after Encryption ... University program offers unparalleled Infosec management education and the ...
      (Security-Basics)
    • Re: Signatures and encryption headers
      ... payload and signatures are sent to the ... cryptographicattacks. ... finalize the hash and check the signature. ... But then this mean you would be using the encryption header before you ...
      (sci.crypt)
    • Re: Digital signatures
      ... emails with a digital signature. ... Fedora than I would one without a signature. ... Assymetric encryption means that there are two keys, ... several forms of attack, but that is for another forum. ...
      (Fedora)