updated it so that it can send encrypted message using public key.