Make 'to_hex' return str like 'to_base64'
Use own 'random' function in RSA