Please Consider: English is My Second Language
This Wikipedia article on HMACs shows a part of a HMAC-MD5 implementation making use of i_key_pad
and o_key_pad
:
# [...]
def hmac_md5(key, msg):
if len(key) > blocksize:
key = md5(key).digest()
key = key + bytearray(blocksize - len(key))
o_key_pad = key.translate(trans_5C)
i_key_pad = key.translate(trans_36)
return md5(o_key_pad + md5(i_key_pad + msg).digest())
# [...]
I really don't know how to even search this further, by I think I understand why they are used (padding). However I was wanting to find out if they also play a role in making the function more secure, and if so, why and how, if they are constant and public?
I could probably do the reading myself; I did try to search for this, but it seems such a specific topic that I, not being a native English speaker, could not find the appropriate English term for further research: if anyone could be kind enough to provide a link or a pointer, I shall be pretty appreciative.
o_key_pad
andi_key_pad
are not public and constant. They are the "padded" versions of the key. – otus Aug 31 '15 at 05:16