I wanted to add encryption function to my project. I researched and found the following seems like quite straight forward to implement but still I need some clarifications.