惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

OpenResty

分享一个在 openresty 搭建 long polling 推送服务的配置文件 - V2EX 云原生网关 Kong 源码分析 - V2EX v2 有没有用 openresty 开发的? OpenResty 使用 ngx_balancer.set_current_peer() 方法不能设置域名,那对于转发到某个域名的情况要怎么做? - V2EX 用 Nginx Openresty 写个网站,写得很痛苦 - V2EX 这个节点这么冷清? - V2EX [赠票活动 / 北京] BearyChat 邀请你一起参加 OpenResty Con 2015 - V2EX OpenResty 目前有没有在稳定维护中的 PPA? - V2EX 一个可以调试 OpenResty 的 Lua 代码的 IDE - V2EX
OpenResty 中有 openssl_sign() 的实现么? - V2EX
Livid · 2014-09-17 · via OpenResty

  • OpenResty
  • 实现
  • openssl_sign

    7 条回复    2015-08-26 14:37:42 +08:00

    LazyZhu

    1

    LazyZhu      2014 年 9 月 17 日   ❤️ 1
    Livid

    2

    Livid  

    MOD

    OP

    PRO

       2014 年 9 月 17 日

    @LazyZhu 非常感谢。我试试。

    Livid

    3

    Livid  

    MOD

    OP

    PRO

       2014 年 9 月 17 日

    @LazyZhu 对这块不熟,那么理论上 openssl_sign 和 hash_hmac 如果 key,data,algo 都一样的话,结果会是一样的么?

    LazyZhu

    4

    LazyZhu      2014 年 9 月 17 日

    一样的。

    php的话可以这样:
    $src = 'foo';
    $key = 'bar';
    $digest = hash_hmac('sha1', $src, $key);
    echo base64_encode($digest);

    还有Python的实现,只是将MD5换成SHA-1
    http://en.wikipedia.org/wiki/Hash-based_message_authentication_code

    目前只有hmac_sha1,其他方式的话得自己写lua模块来实现了。

    LazyZhu

    5

    LazyZhu      2014 年 9 月 17 日
    Livid

    6

    Livid  

    MOD

    OP

    PRO

       2014 年 10 月 7 日

    @LazyZhu 用代码确认了一下,ngx lua 里的 hmac_sha1 和 openssl sha1 sign 真的不是同一个东西。hmac_sha1 的输出要比 openssl sha1 sign 短很多。

    mixin

    7

    mixin      2015 年 8 月 26 日

    @Livid ngx_lua 里面的 hmac_sha1 和 openssl sha1sigb 是一个东西。

    hmac-sha1 的输出时二进制串,一般要转化成十六进制的