Implement key generation
Implement and test key generation