Key pair

This pull request contains changes for key pair generation and asymmetric encryption.

Please, notice the commits from the branches `somepatches` and `symmetric_key_fix` are also included here.