Do the key generation for registering on the server

Uses /dev/urandom, which should be 'random enough'. Also uses
base64 encoding, with keys of 32 bytes length.

Change-Id: Id0bad1d414e68acdc71cc3a60f9d070654675cf3