cryptographic-algorithm
To set a cryptographic algorithm to apply when using the key string configured for the key ID, use the cryptographic-algorithm command in Key Chain Key Configuration mode. To disable the cryptographic algorithm for the key ID, use the no form of this command.
Syntax
cryptographic-algorithm {md5 | hmac-sha-1 | hmac-sha-256 | hmac-sha-384 | hmac-sha-512}
no cryptographic-algorithm
Parameters
-
md5— Use MD5 as the cryptographic algorithm.
-
hmac-sha-1— Use HMAC-SHA-1 as the cryptographic algorithm.
-
hmac-sha-256— Use HMAC-SHA-256 as the cryptographic algorithm.
-
hmac-sha-384— Use HMAC-SHA-384 as the cryptographic algorithm.
-
hmac-sha-512— Use HMAC-SHA-512 as the cryptographic algorithm.
Default Configuration
The cryptographic algorithm is not set by default.
Command Mode
Key Chain Key Configuration mode
User Guidelines
Configuring the cryptographic-algorithm command defines the algorithm to use for each key in the key-chain. The same algorithm must be configured for the same key ID on the link partner interface.
Configuring a cryptographic algorithm for a key is mandatory for OSPF key-chain based authentication (command ip ospf authentication with key-chain option). If a key-chain used for OSPF authentication includes a key-id not configured with a cryptographic algorithm, then:
-
If this is the only key in the key-chain, then OSPF packets are not sent on the IP interface and OSPF packets received on the IP interface are dropped.
-
If the key-chain includes additional keys then only the keys configured with a cryptographic algorithm will be used. If a certain time-range (commands accept-lifetime or send-lifetime) is covered only by the key without a cryptographic algorithm, then during this time-range OSPF packets are not sent on the IP interface and OSPF packets received on the IP interface are dropped.
RIP key-chain based authentication (command ip rip authentication key-chain) supports only MD5 authentication. Therefore:
-
If a "cryptographic-algorithm" was not configured for a key, then RIP authentication will use the specified key using the MD5 algorithm.
-
If a "cryptographic-algorithm" was used to configure MD5 algorithm for a key, then RIP authentication will use the specified key using the MD5 algorithm.
-
If a "cryptographic-algorithm" was used to configure any other (non MD5) algorithm for a key, then the key will not be used for RIP authentication.
Example
The following example configures a key chain called keychain1, with a key named string1.
The cryptographic algorithm is set to hmac-sha-256:
switchxxxxxx(config)# key chain keychain1
switchxxxxxx(config-keychain)# key 1
switchxxxxxx(config-keychain-key)# key-string string1
switchxxxxxx(config-keychain-key)# cryptographic-algorithm hmac-sha-256
switchxxxxxx(config-keychain-key)# exit