HMAC SHA-1 stands for Hashed Message Authentication Code using Sercure Hash Algorithm 1. It applies a hash algorithm to data and uses a private key or secret key to provide sender authentication.
Questions tagged [hmacsha1]
302 questions
0
votes
0 answers
using Base64 HMAC SHA1 in Java not getting expected results
I´m trying to use HMAC SHA1 one way algorithm
This is my code
@Test
public void encodeTest() {
String HMAC_SHA1_ALGORITHM = "HmacSHA1";
String EXPECTED_BASE_64 = "g9OrJ8pQNYprnXuBPFXcirrqpxE=";
String text = "encodeme";
String…

mahou5x
- 11
- 1
- 2
0
votes
1 answer
php and java hmac_sha1 hashing are not the same
I'm trying to hash a message to a server side (which I can't change his code) written in php and encoded by HMAC_SHA1 algorithm. I'm writing the code in Java.
the php code is as follows:
$utf8Str = mb_convert_encoding($strToSign,…

Rubin
- 33
- 1
- 7
0
votes
1 answer
http OAuth response error
@Override
protected Boolean doInBackground(Void... params) {
// TODO Auto-generated method stub
HttpClient httpclient = new DefaultHttpClient();
Log.d("HTTP","Exe");
String sw=Sign(token);
…

Amel Jose
- 873
- 2
- 9
- 22
-1
votes
1 answer
Docusign Webhooks
I implemented DocuSign webhooks using ngrok, but the notification takes about 20-25 seconds to hit the application API. Can anyone please verify is this the normal time that it takes to send a notification?

Tharani Ganapathy
- 41
- 4
-1
votes
1 answer
hmacSHA384 from C#
I have a code.PHP code, that generates sha384 hash string.similar to the below code.
$hash=hash_hmac(“sha384”, $aid .
$amount .
$version .
$currency .
$mid .
$mode.
$request .
…

TDM
- 115
- 15
-1
votes
1 answer
Swift equivalent of hash_hmac in PHP
I have been trying to create an oauth_signature in Swift4 which is to be sent and compared with the one already generated in the php backend code using hash_hmac function. I have used the below code to generate the signature, but the result I got is…

Maddy27
- 11
- 2
-1
votes
1 answer
How to convert this Python code into Java?
I wish to convert following python code into Java. This code encodes credit card data using hash algorithms and keys. I have written some Java code based on my understanding below that. I think mainly its about panmackey. I am not sure how to…

amit
- 181
- 2
- 4
- 20
-1
votes
4 answers
Unix time in c#
I came across code from this article, displayed below. Why is it using the Unix time (epochStart)? Can't it just use the UTCNow time instead of subtracting from the epochStart later?
DateTime epochStart = new DateTime(1970, 01, 01, 0, 0, 0, 0,…

bp581
- 859
- 1
- 16
- 47
-1
votes
1 answer
Javascript sha1 + HMCASHA1 Crypto JS encryption for .Net code
Following is how the encyption has been done on backend useing .Net.
public static string ShaEncrypt(string input,string keyStr) {
byte[] key = Encoding.ASCII.GetBytes(keyStr);
HMACSHA1 myhmacsha1 = new HMACSHA1(key);
byte[] byteArray…

Rajeshwaran P
- 69
- 9
-1
votes
3 answers
Converting string in Base64 and HMAC sha1
I need help with making a signature in swift 3 with HMAC SHA1 for a web request.
I have an example in Java but really do not know how to do it in swift.
Java formula:
signature =…

Aleksandr Sabri
- 1
- 6
-1
votes
1 answer
Signed Hmac/sha1 message using Go different result than node.js or Python
I am trying to generate a Hmac/SHA1 signature using Go, but I'm getting different results than when I test with Node.js or Python.
Here's my code in Go:
signature := hmac.New(sha1.New, []byte(signKey))
signature.Write([]byte(buffer))
return…

Azure
- 1
- 1
-1
votes
1 answer
I forgot my AmazonAWS secret key, but I have a couple HMAC signed requests. How can I
The signing function is as follows,
$sig = base64_encode(hash_hmac('sha256', "{$method}\n{$server}\n{$uri}\n{$query_string}", MY_PRIVATE_KEY, true));
$signature = str_replace("%7E", "~", rawurlencode($sig));
How can I deduce MY_PRIVATE_KEY, when I…

Lafix
- 375
- 1
- 3
- 13
-1
votes
2 answers
HMAC digest different in Java and C++
I am trying to integrate 2 systems one uses C++ and other uses Jva for HMAC digest generation.
Following is C++ code:-
static const GUID seedGUID = { 0xd6fecf42, 0x2d1e, 0x4db9, { 0xa2, 0x73, 0xeb,
0x34, 0x13, 0xe, 0xa1, 0x37 }…

user693788
- 19
- 3
-2
votes
1 answer
Code for generating oauth_Signature when you have consumer key, secret, token and tokenkey
I have to test a GET request in jmeter where I have to pass oauth signature as a parameter. I have consumer key, consumer secret, token and token secret. I want to generate it automatically.
-2
votes
1 answer
PHP curl hash_hmac
Need help on this .... I need to get json data from API call from a URL. It said the called needs..
Content-Type : application/x-www-form-urlencoded
HTTP HEADERS : key ---> APIKEY
HTTP HEADERS : sig ---> HMAC-SHA1 signature of POST Data with SECRET…

Rain Lai
- 170
- 1
- 9