created a function for choosing the encryption key