encryption with secret key implemented