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
On this page
  • MAC
  • HMAC
  • How to ???

Was this helpful?

HMAC

PreviousBlock-ciphersNextCMAC

Last updated 4 years ago

Was this helpful?

MAC

In order to understand hex and type parameters read

HMAC

Description: Message authentication code based on hash.

Uses: General porpuse

How to ???

import requests
import json
import os,binascii

def sending(message):
    url = 'http://127.0.0.1:6613/'
    response = requests.post(url, data=message)
    print response.content
    return response.content

data_js='{"version":1,"algorithm":"HMAC","type":"string","plaintext":"Hello world!","hex":0,\
"key":"0123456789ABCDEF0123456789ABCDEF","family":"sha3_512"}'
sending(data_js)

Calculate HMAC-SHA3512 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

{"version":1,"algorithm":"HMAC","type":"string","plaintext":"your string","hex":BOOL,
"key":"hex string","family":"hash flavor"}

Json to HMAC file

{"version":1,"algorithm":"HMAC","type":"file","file":"your file",
"key":"hex string","family":"hash flavor"}
HMAC video
Hash
spec