I'm working on an assignment where I have to compare a brute-force attack on a collision-free MAC vs. a one-way property MAC using the OpenSSL EVP library in C. Just to clarify, I'm not looking for any help on the assignment, just the implementation of EVP.
I've created the following code which creates a hash of the given input string:
OpenSSL_add_all_digests();
// Set Hash Digest
md = EVP_get_digestbyname("MD5");
// Create Hash
EVP_MD_CTX_init(&c);
EVP_DigestInit_ex(&c, md, NULL);
EVP_DigestUpdate(&c, plaintext, strlen(plaintext));
EVP_DigestFinal_ex(&c, hash, &hash_len);
EVP_MD_CTX_cleanup(&c);
This works exactly as needed to create the hash. How do I set the property for one-way vs. collision-free? I was not able to find anything specific in the documentation and just need clarification around this point.