Refactor Encrypt/Decrypt functions into Translate

Add reference to Wikipedia entry and improve comments