Show
The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network.[1] Its most notable applications are remote login and command-line execution. SSH applications are based on a client–server architecture, connecting an SSH client instance with an SSH server.[2] SSH operates as a layered protocol suite comprising three principal hierarchical components: the transport layer provides server authentication, confidentiality, and integrity; the user authentication protocol validates the user to the server; and the connection protocol multiplexes the encrypted tunnel into multiple logical communication channels.[1] SSH was designed on Unix-like operating systems, as a replacement for Telnet and for unsecured remote Unix shell protocols, such as the Berkeley Remote Shell (rsh) and the related rlogin and rexec protocols, which all use insecure, plaintext transmission of authentication tokens. SSH was first designed in 1995 by Finnish computer scientist Tatu Ylönen. Subsequent development of the protocol suite proceeded in several developer groups, producing several variants of implementation. The protocol specification distinguishes two major versions, referred to as SSH-1 and SSH-2. The most commonly implemented software stack is OpenSSH, released in 1999 as open-source software by the OpenBSD developers. Implementations are distributed for all types of operating systems in common use, including embedded systems. DefinitionSSH uses public-key cryptography to authenticate the remote computer and allow it to authenticate the user, if necessary.[2] SSH may be used in several methodologies. In the simplest manner, both ends of a communication channel use automatically generated public-private key pairs to encrypt a network connection, and then use a password to authenticate the user. When the public-private key pair is generated by the user manually, the authentication is essentially performed when the key pair is created, and a session may then be opened automatically without a password prompt. In this scenario, the public key is placed on all computers that must allow access to the owner of the matching private key, which the owner keeps private. While authentication is based on the private key, the key is never transferred through the network during authentication. SSH only verifies that the same person offering the public key also owns the matching private key. In all versions of SSH it is important to verify unknown public keys, i.e. associate the public keys with identities, before accepting them as valid. Accepting an attacker's public key without validation will authorize an unauthorized attacker as a valid user. Authentication: OpenSSH key managementOn Unix-like systems, the list of authorized public keys is typically stored in the home directory of the user that is allowed to log in remotely, in the file ~/.ssh/authorized_keys.[3] This file is respected by SSH only if it is not writable by anything apart from the owner and root. When the public key is present on the remote end and the matching private key is present on the local end, typing in the password is no longer required. However, for additional security the private key itself can be locked with a passphrase. The private key can also be looked for in standard places, and its full path can be specified as a command line setting (the option -i for ssh). The ssh-keygen utility produces the public and private keys, always in pairs. SSH also supports password-based authentication that is encrypted by automatically generated keys. In this case, the attacker could imitate the legitimate server side, ask for the password, and obtain it (man-in-the-middle attack). However, this is possible only if the two sides have never authenticated before, as SSH remembers the key that the server side previously used. The SSH client raises a warning before accepting the key of a new, previously unknown server. Password authentication can be disabled from the server side. UseSSH is typically used to log into a remote machine and execute commands, but it also supports tunneling, forwarding TCP ports and X11 connections; it can transfer files using the associated SSH file transfer (SFTP) or secure copy (SCP) protocols.[2] SSH uses the client–server model. An SSH client program is typically used for establishing connections to an SSH daemon accepting remote connections. Both are commonly present on most modern operating systems, including macOS, most distributions of Linux, OpenBSD, FreeBSD, NetBSD, Solaris and OpenVMS. Notably, versions of Windows prior to Windows 10 version 1709 do not include SSH by default. Proprietary, freeware and open source (e.g. PuTTY,[4] and the version of OpenSSH which is part of Cygwin[5]) versions of various levels of complexity and completeness exist. File managers for UNIX-like systems (e.g. Konqueror) can use the FISH protocol to provide a split-pane GUI with drag-and-drop. The open source Windows program WinSCP[6] provides similar file management (synchronization, copy, remote delete) capability using PuTTY as a back-end. Both WinSCP[7] and PuTTY[8] are available packaged to run directly off a USB drive, without requiring installation on the client machine. Setting up an SSH server in Windows typically involves enabling a feature in Settings app. In Windows 10 version 1709, an official Win32 port of OpenSSH is available. SSH is important in cloud computing to solve connectivity problems, avoiding the security issues of exposing a cloud-based virtual machine directly on the Internet. An SSH tunnel can provide a secure path over the Internet, through a firewall to a virtual machine.[9] The IANA has assigned TCP port 22, UDP port 22 and SCTP port 22 for this protocol.[10] IANA had listed the standard TCP port 22 for SSH servers as one of the well-known ports as early as 2001.[11] SSH can also be run using SCTP rather than TCP as the connection oriented transport layer protocol.[12] Historical developmentVersion 1In 1995, Tatu Ylönen, a researcher at Helsinki University of Technology, Finland, designed the first version of the protocol (now called SSH-1) prompted by a password-sniffing attack at his university network.[13] The goal of SSH was to replace the earlier rlogin, TELNET, FTP[14] and rsh protocols, which did not provide strong authentication nor guarantee confidentiality. Ylönen released his implementation as freeware in July 1995, and the tool quickly gained in popularity. Towards the end of 1995, the SSH user base had grown to 20,000 users in fifty countries.[citation needed] In December 1995, Ylönen founded SSH Communications Security to market and develop SSH. The original version of the SSH software used various pieces of free software, such as GNU libgmp, but later versions released by SSH Communications Security evolved into increasingly proprietary software. It was estimated that by 2000 the number of users had grown to 2 million.[15] Version 2"Secsh" was the official Internet Engineering Task Force's (IETF) name for the IETF working group responsible for version 2 of the SSH protocol.[16] In 2006, a revised version of the protocol, SSH-2, was adopted as a standard. This version is incompatible with SSH-1. SSH-2 features both security and feature improvements over SSH-1. Better security, for example, comes through Diffie–Hellman key exchange and strong integrity checking via message authentication codes. New features of SSH-2 include the ability to run any number of shell sessions over a single SSH connection.[17] Due to SSH-2's superiority and popularity over SSH-1, some implementations such as libssh (v0.8.0+),[18] Lsh[19] and Dropbear[20] support only the SSH-2 protocol. Version 1.99In January 2006, well after version 2.1 was established, RFC 4253 specified that an SSH server supporting 2.0 as well as prior versions should identify its protocol version as 1.99.[21] This version number does not reflect a historical software revision, but a method to identify backward compatibility. OpenSSH and OSSHIn 1999, developers, desiring availability of a free software version, restarted software development from the 1.2.12 release of the original SSH program, which was the last released under an open source license. This served as a code base for Björn Grönvall's OSSH software. Shortly thereafter, OpenBSD developers forked Grönvall's code and created OpenSSH, which shipped with Release 2.6 of OpenBSD. From this version, a "portability" branch was formed to port OpenSSH to other operating systems.[22] As of 2005[update], OpenSSH was the single most popular SSH implementation, being the default version in a large number of operating system distributions. OSSH meanwhile has become obsolete.[23] OpenSSH continues to be maintained and supports the SSH-2 protocol, having expunged SSH-1 support from the codebase in the OpenSSH 7.6 release. UsesExample of tunneling an X11 application over SSH: the user 'josh' has "SSHed" from the local machine 'foofighter' to the remote machine 'tengwar' to run xeyes. Logging into OpenWrt via SSH using PuTTY running on Windows.SSH is a protocol that can be used for many applications across many platforms including most Unix variants (Linux, the BSDs including Apple's macOS, and Solaris), as well as Microsoft Windows. Some of the applications below may require features that are only available or compatible with specific SSH clients or servers. For example, using the SSH protocol to implement a VPN is possible, but presently only with the OpenSSH server and client implementation.
File transfer protocolsThe Secure Shell protocols are used in several file transfer mechanisms.
ArchitectureDiagram of the SSH-2 binary packet.The SSH protocol has a layered architecture with three separate components:
This open architecture provides considerable flexibility, allowing the use of SSH for a variety of purposes beyond a secure shell. The functionality of the transport layer alone is comparable to Transport Layer Security (TLS); the user-authentication layer is highly extensible with custom authentication methods; and the connection layer provides the ability to multiplex many secondary sessions into a single SSH connection, a feature comparable to BEEP and not available in TLS. Algorithms
VulnerabilitiesSSH-1In 1998, a vulnerability was described in SSH 1.5 which allowed the unauthorized insertion of content into an encrypted SSH stream due to insufficient data integrity protection from CRC-32 used in this version of the protocol.[30][31] A fix known as SSH Compensation Attack Detector[32] was introduced into most implementations. Many of these updated implementations contained a new integer overflow vulnerability[33] that allowed attackers to execute arbitrary code with the privileges of the SSH daemon, typically root. In January 2001 a vulnerability was discovered that allows attackers to modify the last block of an IDEA-encrypted session.[34] The same month, another vulnerability was discovered that allowed a malicious server to forward a client authentication to another server.[35] Since SSH-1 has inherent design flaws which make it vulnerable, it is now generally considered obsolete and should be avoided by explicitly disabling fallback to SSH-1.[35] Most modern servers and clients support SSH-2.[36] CBC plaintext recoveryIn November 2008, a theoretical vulnerability was discovered for all versions of SSH which allowed recovery of up to 32 bits of plaintext from a block of ciphertext that was encrypted using what was then the standard default encryption mode, CBC.[37] The most straightforward solution is to use CTR, counter mode, instead of CBC mode, since this renders SSH resistant to the attack.[37] Suspected decryption by NSAOn December 28, 2014 Der Spiegel published classified information[38] leaked by whistleblower Edward Snowden which suggests that the National Security Agency may be able to decrypt some SSH traffic. The technical details associated with such a process were not disclosed. A 2017 analysis of the CIA hacking tools BothanSpy and Gyrfalcon suggested that the SSH protocol was not compromised.[39] Standards documentationThe following RFC publications by the IETF "secsh" working group document SSH-2 as a proposed Internet standard.
The protocol specifications were later updated by the following publications:
In addition, the OpenSSH project includes several vendor protocol specifications/extensions:
See also
References
Further reading
External links
Wikimedia Commons has media related to SSH.
Wikibooks has a book on the topic of: Internet Technologies/SSH
Page 2
In cryptography, Triple DES (3DES or TDES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block. The Data Encryption Standard's (DES) 56-bit key is no longer considered adequate in the face of modern cryptanalytic techniques and supercomputing power. A CVE released in 2016, CVE-2016-2183 disclosed a major security vulnerability in DES and 3DES encryption algorithms. This CVE, combined with the inadequate key size of DES and 3DES, NIST has deprecated DES and 3DES for new applications in 2017, and for all applications by the end of 2023.[1] It has been replaced with the more secure, more robust AES. While the government and industry standards abbreviate the algorithm's name as TDES (Triple DES) and TDEA (Triple Data Encryption Algorithm),[2] RFC 1851 referred to it as 3DES from the time it first promulgated the idea, and this namesake has since come into wide use by most vendors, users, and cryptographers.[3][4][5][6] HistoryIn 1978, a triple encryption method using DES with two 56-bit keys was proposed by Walter Tuchman; in 1981 Merkle and Hellman proposed a more secure triple key version of 3DES with 112 bits of security.[7] StandardsThe Triple Data Encryption Algorithm is variously defined in several standards documents:
AlgorithmThe original DES cipher's key size of 56 bits was generally sufficient when that algorithm was designed, but the availability of increasing computational power made brute-force attacks feasible. Triple DES provides a relatively simple method of increasing the key size of DES to protect against such attacks, without the need to design a completely new block cipher algorithm. A naive approach to increase strength of a block encryption algorithm with short key length (like DES) would be to use two keys ( K 1 , K 2 ) {\displaystyle (K1,K2)} instead of one, and encrypt each block twice: E K 2 ( E K 1 ( plaintext ) ) {\displaystyle E_{K2}(E_{K1}({\textrm {plaintext}}))} . If the original key length is n {\displaystyle n} bits, one would hope this scheme provides security equivalent to using key 2 n {\displaystyle 2n} bits long. Unfortunately, this approach is vulnerable to meet-in-the-middle attack: given a known plaintext pair ( x , y ) {\displaystyle (x,y)} , such that y = E K 2 ( E K 1 ( x ) ) {\displaystyle y=E_{K2}(E_{K1}(x))} , one can recover the key pair ( K 1 , K 2 ) {\displaystyle (K1,K2)} in 2 n + 1 {\displaystyle 2^{n+1}} steps, instead of the 2 2 n {\displaystyle 2^{2n}} steps one would expect from an ideally secure algorithm with 2 n {\displaystyle 2n} bits of key. Therefore, Triple DES uses a "key bundle" that comprises three DES keys, K 1 {\displaystyle K1} , K 2 {\displaystyle K2} and K 3 {\displaystyle K3} , each of 56 bits (excluding parity bits). The encryption algorithm is: ciphertext = E K 3 ( D K 2 ( E K 1 ( plaintext ) ) ) . {\displaystyle {\textrm {ciphertext}}=E_{K3}(D_{K2}(E_{K1}({\textrm {plaintext}}))).}That is, DES encrypt with K 1 {\displaystyle K1} , DES decrypt with K 2 {\displaystyle K2} , then DES encrypt with K 3 {\displaystyle K3} . Decryption is the reverse: plaintext = D K 1 ( E K 2 ( D K 3 ( ciphertext ) ) ) . {\displaystyle {\textrm {plaintext}}=D_{K1}(E_{K2}(D_{K3}({\textrm {ciphertext}}))).}That is, decrypt with K 3 {\displaystyle K3} , encrypt with K 2 {\displaystyle K2} , then decrypt with K 1 {\displaystyle K1} . Each triple encryption encrypts one block of 64 bits of data. In each case the middle operation is the reverse of the first and last. This improves the strength of the algorithm when using keying option 2 and provides backward compatibility with DES with keying option 3. Keying optionsThe standards define three keying options: Keying option 1 All three keys are independent. Sometimes known as 3TDEA[15] or triple-length keys.[16] This is the strongest, with 3 × 56 = 168 independent key bits. It is still vulnerable to meet-in-the-middle attack, but the attack requires 22 × 56 steps. Keying option 2 K1 and K2 are independent, and K3 = K1. Sometimes known as 2TDEA[15] or double-length keys.[16] This provides a shorter key length of 112 bits and a reasonable compromise between DES and Keying option 1, with the same caveat as above.[17] This is an improvement over "double DES" which only requires 256 steps to attack. NIST has deprecated this option.[15] Keying option 3 All three keys are identical, i.e. K1 = K2 = K3. This is backward compatible with DES, since two operations cancel out. ISO/IEC 18033-3 never allowed this option, and NIST no longer allows K1 = K2 or K2 = K3.[15][13]Each DES key is 8 odd-parity bytes, with 56 bits of key and 8 bits of error-detection.[9] A key bundle requires 24 bytes for option 1, 16 for option 2, or 8 for option 3. NIST (and the current TCG specifications version 2.0 of approved algorithms for Trusted Platform Module) also disallows using any one of the 64 following 64-bit values in any keys (note that 32 of them are the binary complement of the 32 others; and that 32 of these keys are also the reverse permutation of bytes of the 32 others), listed here in hexadecimal (in each byte, the least significant bit is an odd-parity generated bit, it is discarded when forming the effective 56-bit keys): With these restrictions on allowed keys, Triple DES has been reapproved with keying options 1 and 2 only. Generally the three keys are generated by taking 24 bytes from a strong random generator and only keying option 1 should be used (option 2 needs only 16 random bytes, but strong random generators are hard to assert and it's considered best practice to use only option 1). Encryption of more than one blockAs with all block ciphers, encryption and decryption of multiple blocks of data may be performed using a variety of modes of operation, which can generally be defined independently of the block cipher algorithm. However, ANS X9.52 specifies directly, and NIST SP 800-67 specifies via SP 800-38A[18] that some modes shall only be used with certain constraints on them that do not necessarily apply to general specifications of those modes. For example, ANS X9.52 specifies that for cipher block chaining, the initialization vector shall be different each time, whereas ISO/IEC 10116[19] does not. FIPS PUB 46-3 and ISO/IEC 18033-3 define only the single block algorithm, and do not place any restrictions on the modes of operation for multiple blocks. SecurityIn general, Triple DES with three independent keys (keying option 1) has a key length of 168 bits (three 56-bit DES keys), but due to the meet-in-the-middle attack, the effective security it provides is only 112 bits.[15] Keying option 2 reduces the effective key size to 112 bits (because the third key is the same as the first). However, this option is susceptible to certain chosen-plaintext or known-plaintext attacks,[20][21] and thus it is designated by NIST to have only 80 bits of security.[15] This can be considered insecure, and, as consequence Triple DES has been deprecated by NIST in 2017.[22] Logo of the Sweet32 attackThe short block size of 64 bits makes 3DES vulnerable to block collision attacks if it is used to encrypt large amounts of data with the same key. The Sweet32 attack shows how this can be exploited in TLS and OpenVPN.[23] Practical Sweet32 attack on 3DES-based cipher-suites in TLS required 2 36.6 {\displaystyle 2^{36.6}} blocks (785 GB) for a full attack, but researchers were lucky to get a collision just after around 2 20 {\displaystyle 2^{20}} blocks, which took only 25 minutes.
OpenSSL does not include 3DES by default since version 1.1.0 (August 2016) and considers it a "weak cipher".[24] UsageThe electronic payment industry uses Triple DES and continues to develop and promulgate standards based upon it, such as EMV.[25] Earlier versions of Microsoft OneNote,[26] Microsoft Outlook 2007[27] and Microsoft System Center Configuration Manager 2012[28] use Triple DES to password-protect user content and system data. However, in December 2018, Microsoft announced the retirement of 3DES throughout their Office 365 service.[29] Firefox and Mozilla Thunderbird[30] use Triple DES in CBC mode to encrypt website authentication login credentials when using a master password. ImplementationsBelow is a list of cryptography libraries that support Triple DES:
Some implementations above may not include 3DES in the default build, in later or more recent versions. See also
References and notes
|