C++ converting hexadecimal md5 hash to decimal integer

Posted by Zackery on Stack Overflow See other posts from Stack Overflow or by Zackery
Published on 2014-06-03T20:49:20Z Indexed on 2014/06/03 21:25 UTC
Read the original article Hit count: 152

Filed under:
|
|
|

I'm doing Elgamal Signature Scheme and I need to use the decimal hash value from the message to compute S for signature generation.

    string hash = md5(message);
    cout << hash << endl;
    NTL::ZZ msgHash = strtol(hash.c_str(), NULL, 16);
    cout << msgHash << endl;

There are no integer large enough to contain the value of 32 byte hexadecimal hash, and so I tried big integer from NTL library but it didn't work out because you cannot assign long integer to NTL::ZZ type. Is there any good solution to this? I'm doing this with visual C++ in Visual Studio 2013.

© Stack Overflow or respective owner

Related posts about c++

Related posts about hash