shake

command
v0.0.0-...-414a959 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2017 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Command shake computes the SHAKE variable-output-length hash functions defined by FIPS-202. It reads its entire input, then produces output until it hits EOF.

Usage:

shake [-n bits]

Flag -n specifies which function to compute, SHAKE128 or SHAKE256. Bits can be 128 or 256. The default is 256.

Examples

Show 10 bytes of the hex-encoded SHAKE-256 digest of the string "hello":

printf hello | shake | head -c 10 | hex

Obtain 2MB of the SHAKE-128 digest of the string "hello" in Go:

cmd := exec.Command("shake", "-n", "128")
cmd.Stdin = strings.NewReader("hello")
cmd.Start()
hash := make([]byte, 2e6)
_, err := ioutil.ReadFull(cmd.Stdout.Read, hash)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL