Re: Cannot understand output of libgcrypt's hashing functions

megamind6155 via Gnupg-devel <[email protected]>
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <[email protected]>
I read out each element in the array as a hexadecimal and the output was 
matching. Thank you for your help.

Yours faithfully,
megamind6155.

On 25/03/24 06:09, Jacob Bachmeyer wrote:
> megamind6155 via Gnupg-devel wrote:
>> Hello,
>>
>> I'm trying to use libgcrypt to generate a hash. I'm pretty new to 
>> programming so I'm just testing out the library.
>>
>> This is the code I've written:
>>
>> [...]
>>
>> As you can see I'm just trying to test out this function. Everything 
>> runs but at the end the printf prints out jibberish which I'm unable 
>> to interpret. How is the hash digest encoded?
> That jibberish is almost certainly a binary MD5 digest of "hello\n". Try 
> piping the output of your program through "hexdump -C" and compare the 
> last bytes to the output of "echo hello | md5sum" at a shell prompt.
> 
> As for how to use this, try writing a simple routine to dump the hash 
> value as hexadecimal instead of trying to print it as a string.
> 
> 
> -- Jacob

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
OpenPGP_signature.asc (application/pgp-signature, 236 B)
-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQRbdQMVO0afc9nKdSS6p4+1A08UjwUCZgEDbgUDAAAAAAAKCRC6p4+1A08Uj3vE
AQCVzKboJwjB6njVHq6386t4T9rGAxfHuOfTAykiPSKWsQD/XF+H/Ewqr0YlouXulLoGFPkrTqkb
9x7GKO5joVo1XQE=
=lXXz
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.