It depends on how securely you expect your customer to be. If the key that you use to encrypt data is widely distributed in the application, it may fall into the hands of someone who can use this key to determine the encryption, and then your message will not be safe. However, if your application extends to a selected set of consumers who, as you know, will not allow an attacker to get a key, then you can be sure that your key will be safe.
The first obvious vulnerability here is a public key. RSA is generally a good protocol, assuming you are using a long key. However, if your key is open, as I said above, all bets are disabled.
source share