I am wondering if anyone could give a second opinion whether the following is secure or not.
I have a system which consist of a mobile device, FTP server and a PC. The mobile device is to upload sensitive data to the FTP server for a PC to download it... After download, the data on the FTP server is deleted.
The PC is in a secure network and can have the sensitive data as plain-text. The data is to be encrypted with AES-256. Since key exchange with symmetric keys is a pain, I would like to encrypt the symmetric key with Asymmetric key.
Protocol I thought to use:
1) The PC would generate an Asymmetric Key pair (public and private key, RSA-2048 or better).
2) Use private key to create a signature of the public key.
3) Upload the public key and its signature to the FTP server.
4) Mobile device downloads the public key and its signature.
5) Mobile device uses the public key to verify the signature.
6) If the signature is verified, we are sure that the public key belongs to the private key in the PC (and not to a potential attacker).
7) Mobile device generates a symmetric (secret) AES-256 key.
8) Mobile device encrypts sensitive with the symmetric key and then uploads the encrypted data to the FTP server.
9) Mobile device encrypts symmetric key with public key and uploads it to the FTP server.
10) Mobile device generates MAC using encrypted symmetric-key as the message and public key as the MAC-key, then uploads the MAC to FTP server. (Is this part necessary?)
11) The PC downloads the following: encrypted data, encrypted AES-256 symmetric-key, MAC of the encrypted symmetric-key. (The PC also deletes the data on the FTP server after the download)
12) The PC calculates the MAC of the downloaded encrypted symmetric-key and compares it with the downloaded MAC. If both, the downloaded and PC-generated MACs match, we can conclude that the encrypted symmetric-key is authentic.
13) The PC decrypts the encrypted symmetric key with the private asymmetric key.
14) The PC decrypts the sensitive data with the symmetric AES-256 key.
The Asymmetric keys are to be changed over a certain period, not exceeding 2 years. The symmetric keys are "session" based i.e. a new key is generated for each dataset.