genkeys implementation