Message-Digest authentication is a cryptographic authentication. A key (password) and key ID are configured on each router. The router uses an algorithm based on the OSPF packet, the key, and the key ID to generate a message digest that appends to the packet.
SEFOS# configure terminal SEFOS(config)# interface vlan 1
SEFOS(config-if)# no ip ospf authentication-key
SEFOS(config-if)# ip ospf message-digest-key 0 md5 asdf
SEFOS(config-if)# ip ospf authentication message-digest
SEFOS(config-if)# exit
SEFOS(config)# exit
SEFOS# configure terminal SEFOS(config)# interface vlan 1
SEFOS(config-if)# no ip ospf authentication-key
SEFOS(config-if)# ip ospf message-digest-key 0 md5 asdf
SEFOS(config-if)# ip ospf authentication message-digest
SEFOS(config-if)# exit
SEFOS(config)# exit
SEFOS# show ip ospf interface 0 vlan1 is line protocol is up Internet Address 10.4.0.2, Mask 255.255.0.0, Area 0.0.0.0 AS 1, Router ID 10.4.0.2, Network Type BROADCAST, Cost 1 Transmit Delay is 1 sec, State 5, Priority 1 Designated RouterId 10.4.0.4, Interface address 10.4.0.4 Backup Designated RouterId 10.4.0.2, Interface address 10.4.0.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 0 sec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with the neighbor 10.4.0.4 Message digest authentication enabled Youngest key id is 0
SEFOS# show ip ospf neighbor detail Neighbor 10.4.0.4, interface address 10.4.0.4 In the area 0.0.0.0 via interface vlan1 Neighbor priority is 1, State is FULL/BACKUP, 5 state changes DR is 10.4.0.4 BDR is 10.4.0.2 Options is 0x2