问题标签 [hmacsha1]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2421 浏览

c - 用于密码的 PBKDF2-HMAC-SHA1 - C 中的示例?

我一直在寻找大约一周的时间来找到一个 C 语言示例,该示例可以使用 BSAFE 或 openssl 加密库作为“将此密码转换为适当的散列形式进行存储”,生成体面的盐并做一个可以说是足够的轮数。

有谁知道婴儿床的例子吗?我很懒,不想自己费力地弄清楚这一切,因为这是另一个项目的一个小(但关键)部分。

谢谢-分贝

0 投票
1 回答
950 浏览

bash - bash 中的 HMAC-SHA1

是否有可用于生成HMAC-SHA1哈希的 bash 脚本?

相当于以下 PHP 代码:

参数

谢谢。

在 bash 中查看HMAC-SHA1

0 投票
0 回答
281 浏览

sha1 - Different HMAC results in C# and C++

I have one solution in visual studio 2010. It has two projects, one is written in C# and the other is written in C++. They are completely independent of one another. I am having an issue trying to produce the same result from the two projects. The C++ project can have no .NET dependencies and the two projects must produce the same result using the SHA1 algorithm. I have my C++ code matching this: http://msdn.microsoft.com/en-us/library/windows/desktop/aa382379(v=vs.85).aspx. I would like to replicate the C++ code in the C# project and get the same result.

Currently, I am getting different results. Does anyone have an idea why?

0 投票
1 回答
14040 浏览

java - 在 Java 中验证 hmac sha1 签名

我想知道如何验证我创建的签名。我创建签名的代码与此类似:HMAC-SHA1: How to do it proper in Java?

我发送消息、签名和公钥来验证签名。公钥和私钥是使用 KeyPairGenerator 生成的。如何使用我必须验证我的签名的公钥?或者你能推荐任何好的 Java 库来签名和验证使用 HMAC SHA1 的签名吗?

0 投票
0 回答
6200 浏览

c++ - 使用 OpenSSL 的 C++ 中的 HMAC-SHA1

在我需要维护的代码中,有一点会破坏 Oauth 签名。我已将问题缩小到 HMAC-SHA1 摘要计算。有这样的代码:

现在encodebase64Mem()似乎没问题,因为其他字符串编码正确。我已经看到了类似的例子,但仍然无法弄清楚为什么摘要计算不正确。感谢任何帮助,谢谢!

0 投票
1 回答
882 浏览

google-maps - Visual Basic 6 和 HMACSHA1 Google v3 签名

我正在寻找在 Visual Basic 6 上开发算法 HMAC-SHA1 的代码。我找到了很多代码,但适用于 .NET、java、C# 等,但不适用于 Visual Basic 6。我很绝望......

谁能帮我?我需要它用于新的 Google V3 标识。

并且不可能改变语言:(

0 投票
2 回答
2497 浏览

c++ - How use custom key in HMAC-SHA1 Crypto++ realisation

I want to implement OAuth 1.0 protocol in my C++ project. In order to create OAuth signature I need to implement HMAC-SHA1 algorithm where key and text will be some string created according to OAuth specification.

I want to use Crypto++ library for implementing HMAC-SHA1. I found this HMAC-SHA1 example on wiki of project:

But I can't understand how instead of random generated string use my created key. I tried just create:

But then appear compiling errors. However when I write:

Then there is no errors.

And what key length I need to specify? Because I will have keys of different lengths (with 48 and maybe 96 symbols).

0 投票
2 回答
3633 浏览

php - OpenSSL HMAC-SHA1 摘要与 Crypto 的不匹配

我已经花了 6 个小时来实现消息签名算法。它根本不起作用:

这是生成摘要的 PHP 代码:

这是在 Node.js 服务器上运行的 JS 做同样的事情:

我不知道这里出了什么问题。我尝试了 SHA256,但它们仍然不同。我还使用了一个用 OpenSSL 生成的私钥,无论是纯文本还是 base64,结果仍然相同(不同的密钥)。

0 投票
2 回答
1502 浏览

java - JAVA 中的 HMAC-SHA1

我正在尝试在 Java 中创建代码以获取带有密钥的消息的 HMAC-SHA1,结果必须与 UBUNTU 中的以下 openssl 命令行匹配: openssl dgst -sha1 -hmac key-in-hex 文件名。过滤器

我在Java中有以下代码:

这两个结果是不同的,这意味着我做错了什么。

有人能帮我吗?

提前致谢。

0 投票
2 回答
1003 浏览

oauth - 在 OAuth 中:使用 MAC-SHA1 还是 RSA-SHA1?

关于 OAuth,最适合使用 HMAC-SHA1 或 RSA-SHA1 的加密/加密方法是什么?

谢谢。