Create generate_random_key() in library c/o @inda5th

Uses the file /dev/urandom (if exists) or /dev/random (fallback). Code
based from original post by @inda5th modified by @enchance.