Merging encryption operations - need to refactor