Coherence
Search…
Coherence
Home
Rand
Hash
Argon2
Poly1305
Stream-ciphers
Block-ciphers
HMAC
CMAC
VMAC
DSA
RSA
DH
ECC
ECDH
Curve-25519
NTRU
Security
Openssl
Json-reference
Links
Understanding-the-code
Powered By
GitBook
HMAC
MAC
HMAC video
In order to understand
hex
and
type
parameters read
Hash
HMAC
spec
Description: Message authentication code based on hash.
Uses: General porpuse
How to ???
1
import
requests
2
import
json
3
import
os
,
binascii
4
5
def
sending
(
message
):
6
url
=
'http://127.0.0.1:6613/'
7
response
=
requests
.
post
(
url
,
data
=
message
)
8
print
response
.
content
9
return
response
.
content
10
11
data_js
=
'
{
"version"
:
1
,
"algorithm"
:
"HMAC"
,
"type"
:
"string"
,
"plaintext"
:
"Hello world!"
,
"hex"
:
0
,
\
12
"key"
:
"0123456789ABCDEF0123456789ABCDEF"
,
"family"
:
"sha3_512"
}
'
13
sending
(
data_js
)
Copied!
Calculate HMAC-SHA3
512 to string
"Hello world!"_ with the key given.
On
data_js["family"]
can be one of
{sha3_512, sha3_384, sha3_256, sha3_224, sha_512, sha_384, sha_256, sha_224, sha_1 ,whirlpool}
Json to HMAC string
1
{
"version"
:
1
,
"algorithm"
:
"HMAC"
,
"type"
:
"string"
,
"plaintext"
:
"your string"
,
"hex"
:
BOOL
,
2
"key"
:
"hex string"
,
"family"
:
"hash flavor"
}
Copied!
Json to HMAC file
1
{
"version"
:
1
,
"algorithm"
:
"HMAC"
,
"type"
:
"file"
,
"file"
:
"your file"
,
2
"key"
:
"hex string"
,
"family"
:
"hash flavor"
}
Copied!
Previous
Block-ciphers
Next
CMAC
Last modified
1yr ago
Copy link
Contents
MAC
HMAC
How to ???