sharand key count-of-bytes
DESCRIPTIONSHA1-RANDOM generates cryptographically secure pseudo random files which should not be compressible by any algorithm that does not know the key used to generate it. Without knowing the key, it is believed to be impossible to compress this file.
prints the SHA1 hash of the key, which can be any ASCII string. If the string has spaces, then enclose it in quotes.
sharand key n
works as above and also creates the file "sharand.out" with length n bytes containing cryptographically secure pseudo random numbers. Given all but one bit of the file, it is not possible to guess the remaining bit with probability greater than 1/2 unless you know the key.
The output is a series of 20 byte strings, x, x, ... x[n/20] such that:
x[i] = SHA1(x[i-1] + key)
where x is a string of 0 bytes, and + denotes concatenation.
$ sharand abc 50 Key hash = A9 99 3E 36 47 06 81 6A BA 3E 25 71 78 50 C2 6C 9C D0 D8 9D Wrote sharand.out (50 bytes)
The contents of sharnad.out
$ od -x sharand.out 7D DF 37 9E DB 9F 0E 14 1F 6D AD EF EC 28 F0 60 2B 2A 76 A8 49 54 13 F2 6E DA 0F 19 CD D9 26 6C 46 8A 2D 17 8B 76 24 C0 0D D1 80 4F E7 22 6C 2A 9A C9