Given some string s
I want to sign, are following methods are equivalent to produce message with signature, assuming it does not matter whether s
is visible in message or not?
s
+ HMAC(s
, secret_key)AES_CBC(
s
+string_of_zeroes
, secret_key)
And validation:
recalculate HMAC of first part of message and compare it to second one
decrypt message and verify that it ends with
string_of_zeroes
If that is true, string_of_zeroes
of what length should be taken to make them equivalent?