Yes, I know that, but I don't know how to do that in code. I've found the
following post:
http://stackoverflow.com/questions/105252/how-do-i-convert-between-big-endian-and-little-endian-values-in-c
http://stackoverflow.com/questions/105252/how-do-i-convert-between-big-endian-and-little-endian-values-in-c
 
where I've tried the method with the template<>, which definitely didn't
give me a correct result.
On that forum they're saying that char's don't have to be converted, but is
that true?

Would it be possible for you to provide me with a code sample on how to
convert a char* to little endian? I know it's probably a stupid question and
I'm taking up your time, but I have to learn it somehow...
Thanks in advance!



Goblin_Queen wrote:
> 
> Thanks for your reply, I had thought of that too because my search lead me
> to such an answer. How can I convert a char* from big endian to little
> endian? I googled for conversion examples but I only found conversions for
> int. I know this is probably a stupid question, but I'm still learning
> C++.
> 
> 
> Dr. Stephen Henson wrote:
>> 
>> On Wed, Mar 18, 2009, Goblin_Queen wrote:
>> 
>>> 
>>> Hello,
>>> 
>>> I'm writing a program that has to sign a SHA1-hash value. I'm using
>>> OpenSSL
>>> to do this. My program has to do the same thing as another program which
>>> makes use of Microsoft Crypto API. In that program the method
>>> "CryptSignHash" was used in order to sign the hash value.
>>> 
>>> When I try to sign a dummy hash value with RSA_sign, the result is
>>> different
>>> from the result I get from CryptSignHash. I've been searching for a
>>> while to
>>> find the reason for this, but haven't found the solution yet.
>>> 
>>> I've also tried to sign the hash with other signature methods in
>>> OpenSSL:
>>> RSA_private_encrypt and EVP_SignFinal. Those gave me an error when I
>>> tried
>>> them, but I don't really know the difference between those 3 methods,
>>> the
>>> documentation isn't very clear, and I'm very new to cryptography
>>> functions
>>> and OpenSSL.
>>> 
>>> Can anyone help me with this and tell me what I should use to get the
>>> same
>>> result as CryptSignHash returns? 
>>> 
>>> If you need to see my code in order to help me, just ask, then I'll post
>>> it.
>> 
>> The output of CryptoAPI is in little endian format, OpenSSL and many
>> others
>> use big endian. Try reversing the bytes.
>> 
>> Steve.
>> --
>> Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
>> OpenSSL project core developer and freelance consultant.
>> Homepage: http://www.drh-consultancy.demon.co.uk
>> ______________________________________________________________________
>> OpenSSL Project                                 http://www.openssl.org
>> User Support Mailing List                    openssl-users@openssl.org
>> Automated List Manager                           majord...@openssl.org
>> 
>> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Difference-between-RSA_sign-and-CryptSignHash-signature-tp22575898p22581485.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to