Blame doc/cha-shared-key.texi

Packit 549fdc
@node Shared-key and anonymous authentication
Packit 549fdc
@section Shared-key and anonymous authentication
Packit 549fdc
Packit 549fdc
In addition to certificate authentication, the TLS protocol may be
Packit 549fdc
used with password, shared-key and anonymous authentication methods.
Packit 549fdc
The rest of this chapter discusses details of these methods.
Packit 549fdc
Packit 549fdc
@menu
Packit 549fdc
* SRP authentication::
Packit 549fdc
* PSK authentication::
Packit 549fdc
* Anonymous authentication::
Packit 549fdc
@end menu
Packit 549fdc
Packit 549fdc
@node SRP authentication
Packit 549fdc
@subsection SRP authentication
Packit 549fdc
Packit 549fdc
@menu
Packit 549fdc
* Authentication using SRP::
Packit 549fdc
* srptool Invocation::             Invoking srptool
Packit 549fdc
@end menu
Packit 549fdc
Packit 549fdc
@node Authentication using SRP
Packit 549fdc
@subsubsection Authentication using @acronym{SRP}
Packit 549fdc
@cindex SRP authentication
Packit 549fdc
Packit 549fdc
@acronym{GnuTLS} supports authentication via the Secure Remote Password 
Packit 549fdc
or @acronym{SRP} protocol (see @xcite{RFC2945,TOMSRP} for a description).
Packit 549fdc
The @acronym{SRP} key exchange is an extension to the
Packit 549fdc
@acronym{TLS} protocol, and it provides an authenticated with a 
Packit 549fdc
password key exchange. The peers can be identified using a single password, 
Packit 549fdc
or there can be combinations where the client is authenticated using @acronym{SRP}
Packit 549fdc
and the server using a certificate.
Packit 549fdc
Packit 549fdc
The advantage of @acronym{SRP} authentication, over other proposed
Packit 549fdc
secure password authentication schemes, is that @acronym{SRP} is not
Packit 549fdc
susceptible to off-line dictionary attacks.
Packit 549fdc
Moreover, SRP does not require the server to hold the user's password.
Packit 549fdc
This kind of protection is similar to the one used traditionally in the @acronym{UNIX}
Packit 549fdc
@file{/etc/passwd} file, where the contents of this file did not cause
Packit 549fdc
harm to the system security if they were revealed.  The @acronym{SRP}
Packit 549fdc
needs instead of the plain password something called a verifier, which
Packit 549fdc
is calculated using the user's password, and if stolen cannot be used
Packit 549fdc
to impersonate the user. 
Packit 549fdc
@c The Stanford @acronym{SRP} libraries, include a PAM module that synchronizes
Packit 549fdc
@c the system's users passwords with the @acronym{SRP} password
Packit 549fdc
@c files. That way @acronym{SRP} authentication could be used for all users
Packit 549fdc
@c of a system.
Packit 549fdc
Packit 549fdc
Typical conventions in SRP are a password file, called @file{tpasswd} that 
Packit 549fdc
holds the SRP verifiers (encoded passwords) and another file, @file{tpasswd.conf},
Packit 549fdc
which holds the allowed SRP parameters.  The included in GnuTLS helper 
Packit 549fdc
follow those conventions. The srptool program, discussed in the next section
Packit 549fdc
is a tool to manipulate the SRP parameters.
Packit 549fdc
Packit 549fdc
The implementation in @acronym{GnuTLS} is based on @xcite{TLSSRP}. The
Packit 549fdc
supported key exchange methods are shown below.
Packit 549fdc
Packit 549fdc
@table @code
Packit 549fdc
Packit 549fdc
@item SRP:
Packit 549fdc
Authentication using the @acronym{SRP} protocol.
Packit 549fdc
Packit 549fdc
@item SRP_DSS:
Packit 549fdc
Client authentication using the @acronym{SRP} protocol. Server is
Packit 549fdc
authenticated using a certificate with DSA parameters.
Packit 549fdc
Packit 549fdc
@item SRP_RSA:
Packit 549fdc
Client authentication using the @acronym{SRP} protocol. Server is
Packit 549fdc
authenticated using a certificate with RSA parameters.
Packit 549fdc
Packit 549fdc
@end table
Packit 549fdc
Packit 549fdc
Packit 549fdc
@showfuncdesc{gnutls_srp_verifier}
Packit 549fdc
Packit 549fdc
@showfuncB{gnutls_srp_base64_encode2,gnutls_srp_base64_decode2}
Packit 549fdc
Packit 549fdc
@include invoke-srptool.texi
Packit 549fdc
Packit 549fdc
@node PSK authentication
Packit 549fdc
@subsection PSK authentication
Packit 549fdc
Packit 549fdc
@menu
Packit 549fdc
* Authentication using PSK::
Packit 549fdc
* psktool Invocation::             Invoking psktool
Packit 549fdc
@end menu
Packit 549fdc
Packit 549fdc
@node Authentication using PSK
Packit 549fdc
@subsubsection Authentication using @acronym{PSK}
Packit 549fdc
@cindex PSK authentication
Packit 549fdc
Packit 549fdc
Authentication using Pre-shared keys is a method to authenticate using
Packit 549fdc
usernames and binary keys. This protocol avoids making use of public
Packit 549fdc
key infrastructure and expensive calculations, thus it is suitable for
Packit 549fdc
constraint clients.
Packit 549fdc
Packit 549fdc
The implementation in @acronym{GnuTLS} is based on @xcite{TLSPSK}.  
Packit 549fdc
The supported @acronym{PSK} key exchange methods are:
Packit 549fdc
Packit 549fdc
@table @code
Packit 549fdc
Packit 549fdc
@item PSK:
Packit 549fdc
Authentication using the @acronym{PSK} protocol.
Packit 549fdc
Packit 549fdc
@item DHE-PSK:
Packit 549fdc
Authentication using the @acronym{PSK} protocol and Diffie-Hellman key
Packit 549fdc
exchange.  This method offers perfect forward secrecy.
Packit 549fdc
Packit 549fdc
@item ECDHE-PSK:
Packit 549fdc
Authentication using the @acronym{PSK} protocol and Elliptic curve Diffie-Hellman key
Packit 549fdc
exchange.  This method offers perfect forward secrecy.
Packit 549fdc
Packit 549fdc
@item RSA-PSK:
Packit 549fdc
Authentication using the @acronym{PSK} protocol for the client and an RSA certificate
Packit 549fdc
for the server.
Packit 549fdc
Packit 549fdc
@end table
Packit 549fdc
Packit 549fdc
Packit 549fdc
Helper functions to generate and maintain @acronym{PSK} keys are also included
Packit 549fdc
in @acronym{GnuTLS}.
Packit 549fdc
Packit 549fdc
@showfuncC{gnutls_key_generate,gnutls_hex_encode,gnutls_hex_decode}
Packit 549fdc
Packit 549fdc
@include invoke-psktool.texi
Packit 549fdc
Packit 549fdc
@node Anonymous authentication
Packit 549fdc
@subsection Anonymous authentication
Packit 549fdc
@cindex anonymous authentication
Packit 549fdc
Packit 549fdc
The anonymous key exchange offers encryption without any
Packit 549fdc
indication of the peer's identity.  This kind of authentication
Packit 549fdc
is vulnerable to a man in the middle attack, but can be
Packit 549fdc
used even if there is no prior communication or shared trusted parties 
Packit 549fdc
with the peer. It is useful to establish a session over which certificate
Packit 549fdc
authentication will occur in order to hide the indentities of the participants
Packit 549fdc
from passive eavesdroppers.
Packit 549fdc
Packit 549fdc
Unless in the above case, it is not recommended to use anonymous authentication. 
Packit 549fdc
In the cases where there is no prior communication with the peers, 
Packit 549fdc
an alternative with better properties, such as key continuity, is trust on first use
Packit 549fdc
(see @ref{Verifying a certificate using trust on first use authentication}).
Packit 549fdc
Packit 549fdc
The available key exchange algorithms for anonymous authentication are
Packit 549fdc
shown below, but note that few public servers support them, and they 
Packit 549fdc
have to be explicitly enabled.
Packit 549fdc
Packit 549fdc
@table @code
Packit 549fdc
Packit 549fdc
@item ANON_DH:
Packit 549fdc
This algorithm exchanges Diffie-Hellman parameters.
Packit 549fdc
Packit 549fdc
@item ANON_ECDH:
Packit 549fdc
This algorithm exchanges elliptic curve Diffie-Hellman parameters. It is more 
Packit 549fdc
efficient than ANON_DH on equivalent security levels.
Packit 549fdc
Packit 549fdc
@end table