Refactored encrypt functionality
Merge pull request #2 from andystructible/refactoring

Refactored encrypt functionality