Changed to use separate slices for encrypt and decrypt
Added function definition for obtaining a slice from an id