I posted this question on "Software Recommendations" previously. I think that my security concerns will be better addressed here.
I am searching for a convenient way to securely transfer a single file from a desktop computer C_D to a mobile computer C_M. C_D runs Linux, C_M runs Android.
A method is secure if a file does not leak to a third party ("confidential") and computers see only the transferred file and nothing more ("least privilege").
A convenient way requires only simple configuration. The file transfer usually is the first and last transfer between C_D and C_M, and a complex configuration process would not pay off. The ideal "configuration process" is when I pick a file and select a connector which the other computer is connected to. Let's denote this requirement as "convenient".
What I thought up so far. An important fact to keep in mind is that to make a transfer "confidential", I need to make sure that the computer I connect to is not a computer belonging to a malicious person standing few meters aside. I can do this by manually typing a password, but typing a password is not "convenient". I can do this by connecting the computers with a "visible" link, for example, a cable. Transfer schemes follow.
- Radio (wireless) link. For example, Wi-Fi, Bluetooth. It is not shielded, so it is not "confidential" without typing a password.
- Optical link. 2.1. Infrared communication is not shielded, so it is not "confidential" too. 2.2. A video camera of one computer pointed to the screen of the other one. I guess that it is more "confidential" than the previous scheme. I don't like that the screen is visible to bystanders. QR Code is an implementation of this scheme for small files. 2.3. A light emitter of one computer inserted into a hole with a light sensor in the other computer, and the gap where the light may escape is covered by rubber. It can be manufactured, but I never heard of such technology in consumer electronics.
- Cable. 3.1. Ethernet. It is present in almost every device nowadays which is "convenient". It requires configuring a network server of some sort (for example, FTP, HTTP), which is not "convenient". 3.1.1. LAN. As I said, it is very likely that C_D and C_M were never connected before, so a LAN would require a configuration. Low on "convenient". Note that this LAN must be isolated from other networks, otherwise the scheme is not "confidential". 3.1.2. Internet. Is not "confidential" unless a network server is protected by a password. Take into account that at least one computer, probably both have no global IP addresses. 3.2. USB. 3.2.1. C_M serves as a MTP storage over USB. I discovered that even the internal flash memory of C_M is accessible. Contradicts "least privilege". 3.2.2. I suppose that other protocols over USB exist, but I never heard of any one that fits.
- Moving a flash memory device between A and B. Wiping the whole partition containing the file by the Unix program "shred" satisfies "confidential". Low on "convenient". For example, I discovered a smartphone where you need to disconnect a battery in order to change a microSD card.
Final thoughts. I did not expect this task to be such a hassle. A solution suggested on "Software Recommendations" requires that I write a script that starts a FTP server to transfer big files. OMG.