generate a one-time pad

dd if=/dev/random | pv -ptab --size 128 --stop-at-size | dd of=~/.onetime/to_foo.pad
Piping dd through pv allows to control the size ot the output file and allows for feedback on speed and progress. Sample output is 128 bytes as seen with xxd. See also: http://www.red-bean.com/onetime/#pad-generation
Sample Output
00000000: 9a28 d3d2 8cee bd80 5e60 caf5 16dc 5109  .(......^`....Q.
00000010: 9d59 16cd 096b 1be4 359c c0f2 c8c9 2ee0  .Y...k..5.......
00000020: 5ee4 70ea b127 b5c3 97c9 5d54 750c 84e0  ^.p..'....]Tu...
00000030: f8bc 8897 3e4f 32eb 1d20 6555 b023 5430  ....>O2.. eU.#T0
00000040: 72cf 6a98 33e2 7eaf 6997 8be0 9c37 e787  r.j.3.~.i....7..
00000050: bbfd 6394 d36d c39e 8fc7 9db3 d0db 28ce  ..c..m........(.
00000060: d034 7584 bb54 4e46 e89e a629 881d b3a0  .4u..TNF...)....
00000070: f9a0 c5ce 752c 55e8 6bc2 cb0a fd2a eaaa  ....u,U.k....*..

0
By: m4r14n0ju
2016-10-05 16:14:03

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: