# What does encryption with RSA public key provide?

I want to know if encryption with RSA public key provides confidentiality and integrity. I'm quite sure that it provides confidentiality but I have concerns about integrity. If an attacker would scramble ciphertext what would be the result I get? Do I need to put some kind of MAC at the end of messages before encryption?

If I have to be more specific about my problem, I want to use RSA for sending tiny requests to a server. I am thinking of encrypting requests with server's public key. Server will also know my public key and send back responses encrypted with my public key. I'm not sure if I'm using these correctly since I'm a beginner in these topics.

Any help would be appreciated.

• I want to use RSA for sending tiny requests to a server and normal TLS/SSL is not enough? And integrity of RSA can be achieved with checking the padding (I hope someone will write something more specific) – gusto2 Dec 13 '17 at 11:13
• I did not analyze this problem by time efficiency but I'm using non-persistent connections to send and receive request and responses. I'm guessing establishing SSL connections would not be more efficient than RSA. – Moustafa Memet Dec 13 '17 at 11:21
• TSL is not an encryption scheme. It is a standardized protocol, for which a lot of proper implementations exist. RSA is an option in a cipher suite. Maybe you should state in which context you are planning to use this and what kind of software this is. – tylo Dec 13 '17 at 12:28
• I'm developing a simple software for chatting in local area network. There will be a server which keeps public keys and addresses of users. I will use TLS protocol between users. But I'm unsure about what to use between users and server. – Moustafa Memet Dec 13 '17 at 12:50
• Is this a product you are planning on selling or just for fun? – mikeazo Dec 13 '17 at 13:23