Using MD5 Keys to Authenticate a NTP Time Server

The Network Time Protocol (NTP) is an InternetEach record in the file describes an authentication key
protocol designed to propagate accurate time aroundin the format: 'key-number' 'encryption-code' 'key'.
a computer network. NTP utilises UDP over TCP/IPThe 'key-number' is a reference to the key. The
to synchronise network time clients to an accurate'encryption code' describes the encryption algorithm in
time reference. This article describes the securityuse, usually 'M' for MD5 encryption. The 'key' field is
aspects of the NTP protocol and specifically usingthe agreed key that is to be encrypted by the
MD5 keys to authenticate a time server.encryption algorithm. A subset of 'trusted keys' may
The Network Time Protocol may be used tobe specified in the NTP configuration file 'ntp.conf'.
synchronise many time critical processes onThis allows a reduced subset of keys to be utilised
distributed computers across a network. The NTPby the server. Allowing compromised keys to be
protocol is therefore a potential security risk. Hackerseasily excluded from use. Trusted keys are specified
or malicious users could attempt to disrupt systemusing the 'trusted-keys' command followed by a
synchronisation by attempting to modify or replicatespace-delimited list of key references.
NTP time stamps.Many CISCO routers utilise secure MD5 authentication
Luckily, NTP has an integral security feature toin the installed implementation of NTP. To enable a
thwart attempts to tamper with system timeCisco router to perform MD5 authentication you must
synchronisation. NTP can use MD5 encrypted keys tofollow a number of steps. Firstly, enable NTP
authenticate time stamps received from a timeauthentication with the 'ntp authenticate' command.
server. Network time clients and devices can utiliseSecondly, define an NTP authentication key using the
secure keys to authenticate time stamps and ensure'ntp authentication-key' command. A unique reference
their source of origin.number identifies each NTP key. The key reference
NTP implements authentication by utilising an agreednumber is supplied as the first paramater to the 'ntp
set of keys between a server and client that areauthentication-key' command. Thirdly, use the 'ntp
encrypted in time stamps. A NTP time server passestrusted-key' command to tell the router which keys
a timestamp to a client with one of a selection ofare valid. The command's only argument is the
keys encrypted and appended to the message.reference number of the key defined in the previous
When a timestamp is received by the client, thestep
security key is un-encrypted and checked against theThe Windows 2000\2003\XP operating systems
list of stored secure keys. In this manner the clientadopt a SNTP (Simple Network Time Protocol)
can ensure that the received timestamp originatedapplication for time synchronisation. The
from the expected time source.implementation used by Microsoft does not include
The Network Time Protocol utilises MD5 (Messageauthentication keys.
Digest Encryption 5) encrypted keys. MD5 is a widelyTo summarise, MD5 key authentication can be utilised
used secure encryption algorithm that utilises ato overcome potential security risks when
128-bit cryptographic hash function. The algorithmimplementing the NTP protocol. Network time clients
outputs a fingerprint of the supplied key, which iscan be sure that timestamps have indeed emanated
appended to the timestamp.from the expected time reference and have not
Linux NTP installations store keys in a file 'ntp.keys'.been intercepted for malicious purposes.