Skip to content

cryptoballot/entropychecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entropy Checker

Build Status Build Status Go Report Card Coverage Status Scrutinizer Issues GoDoc

Entropy Checker is a golang package for Linux that will ensure you have sufficient entropy available before doing important cryptographic operations.

It only works on Linux. Mac, BSD and Windows lack the ability to check entropy levels.

usage example:

package main

import (
	"github.com/cryptoballot/entropychecker"
	"log"
)

func main() {
	// Wait for sufficient entropy to be available
	err := entropychecker.WaitForEntropy()
	if err != nil {
		log.Fatal(err)
	}

	// Now it's safe to do important cryptographic stuff
}

There are two configuration variables provided:

// By default we wait for 128 bits, but if you need more or less you can change it here
entropychecker.MinimumEntropy = 128

// By default we will wait 10 seconds before timing out, but we can set it differently.
// Set it to 0 to never time out
entropychecker.Timeout = 10 * time.Second

About

Check entropy levels on linux before important cryptographic operations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages