Restrict Access with User Names and Passwords
A firewall enables you to control which local resources are available on the
Internet and which IP addresses can access those resources. But firewalls filter
only on the information in IP and other headers. They can’t identify specific,
authorized users who may be using IP addresses that the firewall
doesn’t know about ahead of time.
A solution is to provide authorized users with a password and to require
users to enter the password before accessing a resource. For additional security and to identify who is accessing the resources, you can require a user
name in addition to a password. Each user name and password combination
can be unique to a user, so different users can have different access. The
accepted passwords and user names may be hard-coded into the firmware,
with authorized users informed of the values to use. Or you may want to
allow users to obtain access to a resource by filling out a form that requires
selecting a user name and password. The form can request additional information
as well.
Two words you’ll encounter relating to password protection are authentication
and authorization. A user who wants to access a protected resource must
provide authentication, or proof that the user has permission to access the
resource. On receiving a valid user name and password, the server grants
authorization, or permission, to access the resource.
Basic Authentication and Digest Authentication
The examples at the beginning of this networking tutorial showed how to use Basic
Authentication to require a user name and password before accessing a
resource.
A more secure option than Basic Authentication is Digest Authentication.
To access a resource protected with Digest Authentication, the user must
provide a message digest, which is a 32-character ASCII hex string created
from information provided by both the client requesting the resource and
the server that is hosting the resource. The information that goes into creating
the message digest includes a nonce value that the server returns in
response to a request for a protected resource, a user name, a password, a
realm, and the request. The default method for obtaining the message-digest
string is the MD5 algorithm described in RFC 1321: The MD5 Message-
Digest Algorithm.
The nonce value provided by the server typically incorporates a time stamp
and an Etag value that identifies the resource being requested. The time
stamp enables the server to allow access for a specified time before requiring
re-authentication. A server can use the Etag value to prevent replay attacks, where an unauthorized user requests an updated version of a resource previously
returned to an authorized user.
Rabbit Semiconductor’s Dynamic C includes functions that support Digest
Authentication on Web servers hosted by Rabbit modules. Some older Web
browsers don’t support Digest Authentication.
Encrypt Private Data
The fourth rule for securing network resources is to encrypt data that must
remain private. Basic and Digest Authentication encrypt passwords. It’s also
possible to encrypt any data exchanged between two computers.
Encrypting and decrypting large amounts of data can take up a lot of CPU
cycles and time. On small embedded systems, the challenge is to obtain the
needed security without overwhelming the system’s resources. Options such
as AES encryption and stand-alone firewalls that support Virtual Private
Network protocols are two possible solutions for embedded systems.
AES (Rijndael) Encryption
In 1997, the U.S. National Institute of Standards and Technology (NIST)
began a search for a new encryption standard that was royalty-free, easy to
implement even on small embedded systems, and able to withstand attack.
In 2001, Federal Information Processing Standard (FIPS) 197 designated
the Rijndael algorithm the winner of the search. The algorithm was named
the government’s Advanced Encryption Standard (AES) to use for sensitive
but unclassified information. Entities other than the U.S. Government are
welcome to use the algorithm as well, of course.
Rabbit Semiconductor’s Dynamic C offers a library module with support
for the Rijndael Advanced Encryption Standard (AES) cipher.
Virtual Private Networks
Another option for securing network data is a virtual private network
(VPN). The computers at each end of the VPN can use authentication and
encryption to ensure that the data is secure from spying and to block all
other traffic from entering the VPN.
The program code required to implement a VPN can be too complex and
time-consuming to develop for a small embedded system. However, just
about any system can communicate over a VPN by VPNs use IP Security (IPsec) protocols for encryption and authentication. A
variety of RFC documents cover the protocols. A good place to start is with
RFC 2411: IP Security Document Roadmap.
To establish a VPN, a computer at each end of the network must have software
that knows how to use the required protocols to establish a connection
to the other end. Windows XP includes an IPSec Security Manager that
enables PCs to communicate over a VPN. For embedded systems, the easiest
way to support VPN is to connect the system to a firewall device that
supports VPNs.
Firewalls that support VPNs typically include a variety of configuration
options. At the local network, you can enable a single IP address, an entire
subnet, or a user-specified range of addresses within a subnet to access the
VPN. You can specify that the local network will accept VPN communications
from a specified IP address or domain name, or from any requesting
host.
To use encryption, both ends of the VPN must agree on the type of encryption
to use and they must share a key that enables each end to encrypt and
decrypt network traffic. Encryption options include AES and the older
methods 3DES and DES. Authentication options include MD5 and the
more secure 160-bit Secure Hash Algorithm (SHA).
When both ends have been configured, the devices can communicate and
attempt to establish the VPN. When the VPN has been established, the two
devices can use encryption to transfer data securely.
Secure Sockets Layer Encryption
Many Web browsers support the Secure Sockets Layer (SSL) protocol for
encrypting data such as the credit-card numbers customers send to on-line
retailers. SSL uses public-key cryptography, which uses separate keys for
encrypting and decrypting. The computer requesting the encrypted data
generates a public key for encrypting and a private key for decrypting. The
sender of the data uses the public key in encrypting the data. Decrypting
requires the private key, which only the receiving computer has access to.
SSL encryption is very secure but requires more resources than many small
embedded systems can provide. Netburner is one company that offers SSL
support for its products, which use Motorola’s 32-bit ColdFire processors.
|