Refactored existing code and added support for symmetric encryption.

on receiving side -> on the receiving side