Consider a scenario that the data being stored on the server is not really that secured as we might think. In that case the data being stored is prone to the server attacks and isn't resistant to the attacks at data in transit, data at rest.
Therefore to protect against that we use RSA algorithm to protect the data in TRANSIT and the data at REST.
The data being sent on the server is not later on decypted before storing.
The cipher keys are only stored on the client side.
Therefore only the client can encrypt or decrypt the data being transferred.
Thus we try to secure the data at rest and the data in transit
Example: We try to store a file on server.For that we first save the cipher RSA keys locally.
Using these KEYS we encrypt the data before the transfer begins.
After retrieving the file we decypt the file using the RSA private key.
The file data that is being stored on the remote location is transferred using the PYTHON-SOCKET programming.
The data stored in the file is encrypted using the RSA ALGORITHM
The file content amount that could be encrypted is limited due to the limitation in small key size.
Hence, we can create a business logic that breaks the file size into small chunks that equivalent or less that the keys size or use a better cipher algorithm like the ECC Cipher Algorithm