I need to save user email on a public database but I don't want to do it in plaintext, so I need to hash it. If somebody wants to verify if some email exists in the public database, he or she can calculate hash and check if the hash is there.
I don't want any other user to find out what the email is by knowing only a hash. I know that SHA256 is fast to compute so it will be easy to brute force those hashes.
The question is: is HMAC-SHA256 more secure for "hidding" email? Every email will be associated with a 256-bit random key, the verifier will know the email and it's secret so it will be feasible for him or she to calculate the hash and see if it exists on blockchain.
I believe, HMAC-SHA256 will be more secure in this case than SHA256 because the attacker who wants to brute force the email needs not only to brute force email but also the key which is a 256-bit long.