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

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

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 的输出时二进制串,一般要转化成十六进制的