Suppose there is a hashing function:
$$ph = bcrypt(sha256(m + k), salt)$$
Here $ph$ is a password hash obtaining by applying $bcrypt$ on $sha256$ result of concatenating a message $m$ with a secret key $k$. Assuming that
- key $k$ is not visible to attacker;
- key is a "truly" random sufficiently large string;
- the work factor of $bcrypt$ is sufficiently large as well;
The question is how much is this schema secure? Can an attacker obtain the secret key $k$ by issuing messages $m$ and retrieving hashes $ph$ and how much efforts will it take? How much does the strength of this schema depend on the size of the key?
Are there any ways to improve this schema?
I thought such schema may be used for MAC. Should I use HMAC+SHA512
instead?
c
is not a ciphertext. A ciphertext is the result of encryption. This is a (password) hash result (some people may go for the phash term here). I don't think you can compare that with a IND_CPA as used for a block cipher based encryption scheme. $\endgroup$