Cleaning up example encryption logic to use key provider
Merging Jay's changes