In order to easily transport the content of a bcrypt encoded file (or any other binary file for that matter), I like converting its content into 7bit ASCII, enabling inline mail transmission (or even a printout!) for example. A uuencode or a conversion to Base 64 will do the trick. These invocations will do the trick nicely, depending on which tools you have.

To encode (convert from binary to ASCII)

uuencode file.bfe > file.ascii
perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' < file.bfe > file.ascii
openssl enc -a -in file.bfe out file.ascii   

and to decode (i.e. convert from ASCII back to binary)

uudecode file.ascii
perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.ascii > file.bfe
openssl enc -a -d -in file.ascii -out file.bfe


blog comments powered by Disqus