4 Jul 2007 18:26
Generating Random Passwords with definable length
Matthias Schniedermeyer <ms <at> citd.de>
2007-07-04 16:26:23 GMT
2007-07-04 16:26:23 GMT
Hi Today i had the "problem" that i wanted to create an AES256 Keyfile for loop-aes. According to README a SHA512 Hash is used to generate the encryption key. Taking aside the fact halve the bits aren't really put to use here, SHA512 still means 64 Byte of raw entropy. The "standard" example only(tm) gives 45 bytes of entropy, so i thought about how i can create random passwords with definable length, only using standard unix tools. So i stumbled over the "openssl" executable and it's many options. Which i think sould be available on many systems. With `openssl enc -base64 -A` you can create base64 encoded strings with arbitrary length. So with a little loop around that you can create key-files with arbitrary sized lines. - snip - for dat in `seq 1 65`; do head -c 90 /dev/random | openssl enc -base64 -A ; echo ; done | gpg --symmetric -a >/a/usbstick/keyfile.gpg - snip - 90 bytes of entrophy or 120 chars per line in this example. I think this is also a bit more elegant than the `head`ing and `tail`ing in the README. Bis denn(Continue reading)
RSS Feed