Changing implementation to send api key secret encryption parameters and adding decryption tests.