def generate_RSA(bits=2048):
    """
    Generate an RSA keypair
    :param bits: Int. The key length in bits
    :return: String. private key
    :return: String. public key
    """
    from Crypto.PublicKey import RSA
    new_key = RSA.generate(bits, e=65537)
    public_key = new_key.publickey().exportKey('PEM')
    private_key = new_key.exportKey('PEM')
    return private_key.decode('unicode_escape'), public_key.decode(
        'unicode_escape')
