Documentation
¶
Overview ¶
Package entropy contains functions for checking the entropy of given data
Index ¶
Examples ¶
Constants ¶
View Source
const ( Base64Threshold = 4.5 HexThreshold = 3.0 )
Define entropy thresholds over which a string is considered complex enough to be a potential key
Variables ¶
This section is empty.
Functions ¶
func CalculateShannon ¶
CalculateShannon calculates the shannon entropy for a block of data - http://blog.dkbza.org/2007/05/scanning-data-for-entropy-anomalies.html
Example ¶
package main import ( "fmt" "github.com/ONSdigital/git-diff-check/entropy" ) func main() { password := []byte("verysecret") if entropy.CalculateShannon(password) < entropy.Base64Threshold { fmt.Println("Password not complex enough!") } }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.