博客
关于我
理解hmac module in Python
阅读量:348 次
发布时间:2019-03-04

本文共 529 字,大约阅读时间需要 1 分钟。

  • This module implements the HMAC algorithm as described by .

  • functions
    hmac.new(key, msg=None, digestmod='')hmac.digest(key, meg, digest)
  • mothods from HMAC object
    HMAC.update(msg) # m.update(a);m.update(b) is equivalent to m.update(a+b)HMAC.digest()HMAC.hexdigest()HMAC.copy()HMAC.digest_sizeHMAC.block_sizeHMAC.compare_digest(a,b)
  • Usage Example

    import hmacmessage = b'Hello, world!'key = b'secret'h = hmac.new(key, message, digestmod='MD5') # 如果消息很长,可以多次调用h.update(msg)h.hexdigest()
  • References

  1. — Secure hashes and message digests

转载地址:http://upge.baihongyu.com/

你可能感兴趣的文章
net包之IPConn
查看>>
net发布的dll方法和类显示注释信息(字段说明信息)[图解]
查看>>
Net处理html页面元素工具类(HtmlAgilityPack.dll)的使用
查看>>
Net操作Excel(终极方法NPOI)
查看>>
Net操作配置文件(Web.config|App.config)通用类
查看>>
Net连接mysql的公共Helper类MySqlHelper.cs带MySql.Data.dll下载
查看>>
NeurIPS(神经信息处理系统大会)-ChatGPT4o作答
查看>>
neuroph轻量级神经网络框架
查看>>
Neutron系列 : Neutron OVS OpenFlow 流表 和 L2 Population(7)
查看>>
new Blob()实现不同类型的文件下载功能
查看>>
NEW DATE()之参数传递
查看>>
New Journey--工作五年所思所感小记
查看>>
New Relic——手机应用app开发达人的福利立即就到啦!
查看>>
new work
查看>>
new 一个button 然后dispose,最后这个button是null吗???
查看>>
new一个对象的过程
查看>>
new对象时,JVM内部究竟藏了什么小秘密?
查看>>
new操作符的实现原理
查看>>
Next.js React Server Components 教程
查看>>
NextGen Mirth Connect XStream反序列化远程代码执行漏洞(CVE-2023-43208)
查看>>