I'm currently writing a program in C on OpenBSD. I need to compute a SHA256 hash of several strings. I know there is a tool sha256
that I could use on the console, but I need to use either that or a native Unix library to compute it.
Is there any .h
file I have to include I may have missed?
I already tried to search the man pages and the internet, but ended every time with the console tool, but I need to call it via my C program.
I know there is a library with crypt
, which supports Blowfish; I'd need a library with sha256
to call it like the blowfish
version:
printf("hash: %s" crypt(tohash, salt));
Edit: the proposed post with solution doesn't address this problem, since the post addresses C++ and OpenSSL; here we have only C and no external libraries.