SFTP is still relevant in 2023 and is the only file transfer protocol that features inherent forward secrecy.
In today’s post-COVID world, life feels almost the same as it did pre-pandemic. Three years ago, in July 2020, while we were stuck at home in lockdown, we published an article titled “SFTP is not dead, it’s alive and well… and you need it.” At the time, the urgency and importance of data transfer security had increased even more with remote work and reliance on the internet, rather than the corporate LAN. Although many people have returned to their offices, the need to protect data is still paramount. As many economies weaken, there is a trend towards “alternative” jobs, including cybercrime. Recent developments in AI have provided cybercriminals with even more tools to exploit.
In our previous article, we discussed why the SFTP protocol is the only viable option for secure data transfer, and today, three years later, if anything it has become even more important. We cannot emphasize enough the importance of SFTP, particularly in light of the trend to use “secure” file transfer offered by cloud providers.
This article aims to deepen your understanding and knowledge of forward secrecy, a key and inherent security feature of SFTP. SFTP (SSH File Transfer Protocol) is a protocol that is commonly used by businesses and organizations that need to transfer sensitive data, such as financial information or personal data, over the internet in a secure manner.
Forward secrecy, also known as perfect forward secrecy, is a property of cryptographic protocols that ensures that even if an attacker gains access to the private keys used in a session, they will not be able to decrypt any previous or future sessions. In SFTP, forward secrecy is achieved through the use of cleverly designed key-exchange algorithms, like Elliptic Curve Diffie-Hellman (ECDH) for example.
During the initial connection setup, the client and server both generate a set of temporary keys, which they then use to negotiate (or, actually, co-compute) a shared secret key. This shared key is then used to encrypt all data transferred during the session. Because the temporary keys used in the key exchange are generated a new for each session, even if an attacker were to gain access to the private keys used in a particular session, they would not be able to use them to decrypt any other sessions. This makes it much more difficult for attackers to gain access to sensitive data, even if they are able to compromise the security of one session. Furthermore, a key-exchange session is far shorter than the entire client/server connection. In fact a renegotiation of all mentioned keys occurs automatically every N seconds (configurable) or M number of bytes transferred, whichever comes first. So, when an SFTP client connects to an SFTP server to transfer data, and the connection lasts, say, 30 minutes, transferring ~100 MB in total, it’s not uncommon for the described key-exchange session to occur several dozen times. SSL/TLS-based protocols (like FTPS or HTTPS for instance) can be configured for forward secrecy, but it’s not an inherent property, so one can never take it for granted, whereas with SSH2 (and therefore SFTP) forward secrecy is an inherent property of the key-exchange algorithms mentioned above and of the methodology with which they are applied.