Quite some time seems to be spent on decrypting private keys which can be reduced. Hence, the encryption of keys should only be done for cases that are actually testing key encryption/decryption and not for every other case.
The current runtime is around 42 seconds.
I will try to work on this.