#!/bin/sh
#
#  A tool which generates strong shared secrets.
#
openssl rand -base64 12 2>/dev/null && exit 0

(dd if=/dev/urandom bs=1 count=12 2>/dev/null | base64 2>/dev/null) && exit 0

(dd if=/dev/urandom bs=1 count=12 2>/dev/null | base32 2>/dev/null) && exit 0

(dd if=/dev/urandom bs=1 count=12 2>/dev/null | (hexdump -ve '/1 "%02x"' && echo 2>/dev/null)) && exit 0

echo "Failed finding 'openssl', 'base64', 'base32', or 'hexdump' tools".
exit 1
