hash_func(key + msg)
to obtain a MAC (message authentication code) is considered insecure (see the details). It is recommended to use the HMAC algorithm instead, e.g. HMAC-SHA256
or HMAC-SHA3-512
or other secure MAC algorithm.hash_func
can be any cryptographic hash function like SHA-256
, SHA-512
, RIPEMD-160
, SHA3-256
or BLAKE2s
.