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
  • CMAC
  • How to ???

Was this helpful?

CMAC

PreviousHMACNextVMAC

Last updated 4 years ago

Was this helpful?

MAC

In order to understand hex and type parameters read

CMAC

Description: Message authentication code based on block cipher.

Uses: When a block cipher is more readily available than a hash function

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":"CMAC","type":"string","plaintext":"Hello world!",\
"hex":0,"key":"0123456789ABCDEF0123456789ABCDEF","family":"aes"}'
sending(data_js)

Calculate CMAC-AES to string "Hello world!" with the key given.

On data_js["family"] can be one of {"aes", "rc6", "mars","serpent","twofish', "cast256"}

Json to HMAC string

{"version":1,"algorithm":"CMAC","type":"string","plaintext":"your string","hex":BOOL,
"key":"Hex stringsize=32-64","family":"block flavor"}

Json to HMAC file

{"version":1,"algorithm":"CMAC","type":"file","file":"your file",
"key":"Hex stringsize=32-64","family":"block flavor"}
Hash
spec