Hello .. I 'm doing sha1 program.
I don't know why this source result show below errors.

sha3.cpp:11: error: invalid conversion from ‘unsigned char*’ to ‘const char*’
sha3.cpp:11: error: initializing argument 1 of ‘size_t strlen(const char*)’

Thanks you.

#include <stdio.h>
#include <string.h> 
#include <openssl/sha.h>

int main()
    int i;

    unsigned char ibuf[] = "Hello, World!";
    unsigned char obuf[20];
    SHA1(ibuf, strlen(ibuf), obuf);

    for (i = 0; i < 20; i++) {
        printf("%02x ", obuf[i]);

    return 0;
Salem commented: >10 posts, and still no code tags - when are you gonna learn!? -4