Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature

From: Ryan Menezes [MSFT] (ryanmen_at_online.microsoft.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 11:54:47 -0800

It should be pretty straighforward if you have a byte array of size x. Swap
b[0] and b[x], then b[1] and b[x-1] and so forth in a loop.

-- 
Thanks,
Ryan Menezes [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Emile Deen" <anonymous@discussions.microsoft.com> wrote in message
news:809A6C27-2ADC-4770-A5C2-420070F39815@microsoft.com...
> Does anyone have any sample code that demo's how to convert from
big-endian (Java) to little-endian using C++?
>
> Also, is there a way to tell which byte ordering is being used?  I'm
running into the same issue (I think) as the original poster but I have both
Java and Crypto-API clients.
>
>      ----- Daniel McGloin wrote: -----
>
>      "Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
news:<OP3XZdZxDHA.2676@tk2msftngp13.phx.gbl>...
>      > "Daniel McGloin" <dmcgloin@san.rr.com> wrote in message
>      >> I am getting an error verifying a signature created with BSAFE.
The
>      >> error returned from CryptVerifySignature is NTE_BAD_SIGNATURE.  I
have
>      >> tried to verify all inputs (i.e. signature, message file, public
key)
>      >> to make sure they are correct.
>      >> Keep in mind that the CryptoAPI uses little endian byte order and
that most
>      > other products use big endian byte order.
>      > Have you tried reversing the contents of 'signatureKeyData'?
>      >> Regards,
>      > Pieter Philippaerts
>      > Managed SSL/TLS: http://www.mentalis.org/go.php?sl
>
>      Wait!  You're right!!!  I needed to reverse the entire 64 byte
stream.
>       I still don't understand this.  But it works and I am very happy and
>      I am going to leave work and go home!
>
>      Thanks very, very much.  You made my day.
>


Relevant Pages

  • Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature
    ... > I am getting an error verifying a signature created with BSAFE. ... Keep in mind that the CryptoAPI uses little endian byte order and that most ...
    (microsoft.public.platformsdk.security)
  • Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature
    ... >> I am getting an error verifying a signature created with BSAFE. ... > Keep in mind that the CryptoAPI uses little endian byte order and that most ... > other products use big endian byte order. ... > Have you tried reversing the contents of 'signatureKeyData'? ...
    (microsoft.public.platformsdk.security)
  • Re: Trouble verifying RSA signature generated with c#
    ... Reversing the signature bits fixed my problem. ... The signature blob generated oRSA.Sign is in standard big-endian order. ... BOOL GetFileBytes(LPCWSTR path, BYTE** buffer, ULONGLONG& bufferSize) ...
    (microsoft.public.platformsdk.security)
  • Re: Most negative double value
    ... Christian Bau wrote: ... this is right if I am writing robust code to run everywhere... ... >>tries to find machine endianess and is part of my signature... ... >>endian or little endian... ...
    (comp.lang.c)
  • Re: HELP: VerifySignature
    ... that problem may be reversing the bites. ... the signature from CAPI reverse the bites so that first bite comes on last ... >> I could verify the openssl generated sig with the same function. ...
    (microsoft.public.platformsdk.security)