사용자 도구

사이트 도구


hmac

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

hmac [2014/12/04 17:56]
kwon37xi 만듦
hmac [2014/12/04 17:58]
kwon37xi
줄 1: 줄 1:
 ====== HMAC ====== ====== HMAC ======
   * [[https://en.wikipedia.org/wiki/Hash-based_message_authentication_code|HMAC Hash based message authentication]]   * [[https://en.wikipedia.org/wiki/Hash-based_message_authentication_code|HMAC Hash based message authentication]]
 +
 +===== Python example =====
 +<code python>
 +from hashlib import sha256
 +from hmac import HMAC
 +from base64 import b64encode
 + 
 +# encode message with HMAC_SHA1
 +hm = HMAC('secretKey', 'message', sha256)
 +
 +# to hexdigit
 +hmac_auth = hm.hexdigest()
 + 
 +# or to base64 string
 +hmac_auth = b64encode(hm.digest())
 +</code>
  
hmac.txt · 마지막으로 수정됨: 2014/12/04 17:58 저자 kwon37xi