No matching cypher found
Setup
Problem
Connecting from a Cisco 2960 switch to a Cisco 1941 router using SSH gives a "no matching cypher found" error. (Nevermind the date/time settings on switch and router, they are a bit off as I set them manually).
Cipher list on the switch.
First things first. What does a cipher list like aes256-cbc mean on a Cisco 2960 switch?
It refers to the encryption method used for secure communication, for example, with SSH (Secure Shell) or for securing data transfer.
- AES: Advanced Encryption Standard, a highly secure and widely used encryption standard.
- 256: The key size in bits. In this case, it is a 256-bit key, which provides a very high level of security.
- CBC: Cipher Block Chaining, a mode of AES that provides additional security by making each data block dependent on the previous block.
When you run ssh -c ?
the system displays a list of all supported encryption algorithms for the SSH client that can be used when establishing an SSH connection to another device. When you run show ip ssh
, it shows the default configured and supported encryption algorithms for the SSH server service, should the client be running one. This indicates which algorithms will be used by default when an SSH connection is established to the switch. In this case, the switch is not running an SSH server.
Cipher list on the router.
On a Cisco 1941 router, e.g. aes256-ctr refers to a different mode of the AES encryption standard, where:
- AES: Advanced Encryption Standard.
- 256: The key size in bits, again 256 bits.
- CTR: Counter mode, a mode of AES where a counter is used to make each data block independent of the other blocks.
In CTR (Counter) mode, a counter value is combined with an initial value and then encrypted. The resulting output is then combined with the plaintext block to form the encrypted text block. This mode makes each block encryption independent, which has advantages such as the ability to encrypt and decrypt blocks in parallel, improving speed.
Different cypher lists.
Why is e.g. aes256-ctr not available on a Cisco 2960 switch?
- Hardware and software support: Not all devices support all encryption modes. The absence of aes256-ctr on the Cisco 2960 switch may be due to hardware or software limitations of the switch. Cisco 2960 switches are primarily designed as access switches and may not have the same extensive cryptographic capabilities as a router like the Cisco 1941.
- Different use cases: Switches and routers often have different use cases. Routers, such as the Cisco 1941, are more often used for WAN connections and VPN tunnels, where strong and flexible encryption is necessary. Therefore, they may support a broader range of encryption algorithms and modes. Switches, on the other hand, are usually used within LANs and may not need the same level of encryption support.
- Configuration and licenses: The available cipher suites on a switch or router may also depend on the configuration, the IOS version, or specific licenses installed on the device.
It is important to consult the documentation of specific Cisco devices and IOS versions to know which encryption methods and modes are supported.
Solution
You can customize the list of supported and used encryption algorithms for the SSH server through Cisco IOS configuration. This can be done by adjusting the SSH server configuration to add or remove specific ciphers. This example would limit the show ip ssh output
to only the specifically configured algorithms: