3

On Openssl's official website I read that its recommended to use EVP interface. But somewhere else, (can't find a link at the moment, just forgot) read that now we shouldnt use it any more, that its depreciated. Right, using EVP is much much easier but what is the right way to do it (not the easiest way)?

For example: I can do a MD5 hash in two ways with Openssl:

MD5(plaintext, strlen(plaintext), digest);  

and:

MD5_CTX ctx;
MD5_Init(&ctx);
MD5_Update(&ctx, plaintext, strlen(plaintext));
MD5_Final(digest, &ctx);

Both solutions work but which one is correct and should be used nowadays?

ivy
  • 1,445
  • 3
  • 15
  • 20

0 Answers0