First of all, try studying something about encryption and decryption. writing code after understanding is the best. it will be a nice learning experience for you.
secondly if you need some sort of reference code for your assignment you can check this class:
EncyptionManager.cs[
^]
Check for Encyptiomanager.cs file on this page. This class contains a basic encryption and decryption ad it can be easily used in any application.