0

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.

15) Done!

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.

0

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.

Why do this. Anyone who can create a keypair can sign the public key via the corresponding private key. If I am an attacker I'll just generate my own keypair, sign my public key with my private key and upload it to the FTP. The signature is valid and you'll be none the wiser. At this point everything falls apart. I can decrypt any message by using my private key to get the symmetric key and the associated data.

  • Would you have a solution to this? :) – Rain Apr 18 '16 at 23:47
  • You could use something like diffie hellman key exchange, preferably over a secure (e.g. TLS) connection to exchange a symmetric key between the mobile device and the PC. – puzzlepalace Apr 18 '16 at 23:49
  • I guess a self signed CA would work as well? – Rain Apr 19 '16 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.