Corrected Rsa key generation logic
Adaptations to new key logic