Hash-MAC function comparison in TLS and SP standards

来源:公众号“汽车安全前瞻研究”
2020-05-12
1888

First: basic introduction

We are sure to face with Pseudo Random Number Generator to generate random bits for each key, or cyphertexts, even attackers will using the Pseudo Random Number Generator to produce the One-time Keys foreach kinds of evading, flooding, brute-force attack, so that it has many rulesin itself.

Another important issue is the Hash function. cleardefinition can be found in the SP 800-90:

A (mathematical) function that maps values from alarge (possibly very large) domain into a smaller range. The function satisfiesthe following properties:(1) (One-way) it is computationally infeasible to findany input that maps to any pre-specified output; (2) (Collision free) it iscomputationally infeasible to find any two distinct inputs that map to the sameoutput.

Very known, hash function directly using onecompressing function to divide up plaintexts into fixed blocks, and thosealgorithm not easily to reverse back to the plaintexts, whose implementation inE-mail, DVD, ZIP files etc.


Second: one way to ensure message authentication and confidentiality simultaneously(SP 800-90)


we directly using Key as the confidentiality and authentication, which is called Hash-MAC, via following process:

(1) Generate function

One thing had to be highlighted is that Hash functionin H-MAC, requires quite strong security strength, listed as following introduction:

(2) Update function

(3) Instantiation and reseed

Reset seed value and counter value, be careful, herethe V_i-1 and V_i different.

As synthesis of SP 800-90A HMAC, we can derivefollowing process:(adapted from the SP 800-90A)


If additional input != Null, then (Key, V_i)=HMAC(additional_input, Key, V_i-1)

m=number_bits(n/outlen)=requested_number_of_bits

temp=nullstring

Fori=1:m:

V_i=HMAC(Key,V_i-1)

temp=templl V_i.

Returned_bits=leftmost(temp,m)

(Key,V_i+1)=HMAC_DRBG_Update(additional_input, Key, V_i).

reseed_counter+=1

Return(SUCCESS,returned_bits, Key, V_final_reseed_counter)



Third: Another way to ensure message authenticationand confidentiality simultaneously(TLS)


From RFC 5246, we can synthesis the TLS HMAC based Pseudo random function, algorithm listed as following:

m=requested_number_of_bits

temp=nullstring

A(0)=seed

Fori=1:m:

A(i)=HMAC(Key,A(i-1))

V_i=HMAC(Key,V_i-1)

temp=templl V_i.

Returned_bits=leftmost(temp,m)

(Key,V_i+1, A(i+1))=HMAC_DRBG_Update(additional_input, Key, V_i, A(i)).

Return(SUCCESS,returned_bits, Key, V_final_reseed_counter, label)


Though TLS didnot provide the detail architecture, wecan easily get out the architecture based on SP version (new added in redlines)


Fourth: Comparison between SP 800-90 and TLS



Thanks for your reading and anything regarding safetyand security, please contact me as soon as possible, we are eager to betogether to solve out all of problems till world ends.


[Reference]

NIST SP 800-90A1

RFC5246


收藏
点赞
2000