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

Was this helpful?

Rand

PreviousHomeNextHash

Last updated 4 years ago

Was this helpful?

How to ???

#!/usr/bin/env python

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

data_js='{"version":1,"algorithm":"RAND_RP","length":12}'
sending(data_js)

In this example we generate 12 random bytes with RAND_RP algorithm without entropy.

  • On data_js["algorithm"] can be one of {RAND_RP, RAND_AUTO, RAND_RDRAND}

To add entropy we need to the parameter "entropy": INT

  • 0 means with entropy using /dev/urandom

  • 1 means with entropy using /dev/random

  • 2 means without entropy

Json to rand

{"version":1,"algorithm":"rand flavor","length":INT ,"entropy":INT}
spec