might be used with X.509 encoded certificates.
2.6 Interface to Cryptographic Transforms
The keying material computed by the key exchange should have at least
90 bits of entropy, which means that it must be at least 90 bits in
length. This may be more or less than is required for keying the
encryption and/or pseudorandom function transforms.
The transforms used with OAKLEY should have auxiliary algorithms
which take a variable precision integer and turn it into keying
material of the appropriate length. For example, a DES algorithm
could take the low order 56 bits, a triple DES algorithm might use
the following:
K1 = low 56 bits of md5(0|sKEYID)
K2 = low 56 bits of md5(1|sKEYID)
K3 = low 56 bits of md5(2|sKEYID)
The transforms will be called with the keying material encoded as a
variable precision integer, the length of the data, and the block of
memory with the data. Conversion of the keying material to a
transform key is the responsibility of the transform.
2.7 Retransmission, Timeouts, and Error Messages
If a response from the Responder is not elicited in an appropriate
amount of time, the message should be retransmitted by the Initiator.
These retransmissions must be handled gracefully by both parties; the
Responder must retain information for retransmitting until the
Initiator moves to the next message in the protocol or completes the
exchange.
Informational error messages present a problem because they cannot be
authenticated using only the information present in an incomplete
exchange; for this reason, the parties may wish to establish a
default key for OAKLEY error messages. A possible method for
establishing such a key is described in Appendix B, under the use of
ISA_INIT message types.
In the following the message type is OAKLEY Error, the KEYID supplies
the H algorithm and key for authenticating the message contents; this
value is carried in the Sig/Prf payload.
The Error payload contains the error code and the contents of the
rejected message.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! !
~ Initiator-Cookie ~
/ ! !
KEYID +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ ! !
~ Responder-Cookie ~
! !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Domain of Interpretation !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Message Type ! Exch ! Vers ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! SPI (unused) !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! SPI (unused) !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Error Payload !
~ ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Sig/prf Payload
~ ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The error message will contain the cookies as presented in the
offending message, the message type OAKLEY_ERROR, and the reason for
the error, followed by the rejected message.
Error messages are informational only, and the correctness of the
protocol does not depend on them.
Error reasons:
TIMEOUT exchange has taken too long, state destroyed
AEH_ERROR an unknown algorithm appears in an offer
GROUP_NOT_SUPPORTED GRP named is not supported
EXPONENTIAL_UNACCEPTABLE exponential too large/small or is +-1
SELECTION_NOT_OFFERED selection does not occur in offer
NO_ACCEPTABLE_OFFERS no offer meets host requirements
AUTHENTICATION_FAILURE signature or hash function fails
RESOURCE_EXCEEDED too many exchanges or too much state info
NO_EXCHANGE_IN_PROGRESS a reply received with no request in progress
2.8 Additional Security for Privacy Keys: Private Groups
If the two parties have need to use a Diffie-Hellman key
determination scheme that does not depend on the standard group
definitions, they have the option of establishing a private group.
The authentication need not be repeated, because this stage of the
protocol will be protected by a pre-existing authentication key. As
an extra security measure, the two parties will establish a private
name for the shared keying material, so even if they use exactly the
same group to communicate with other parties, the re-use will not be
apparent to passive attackers.
Private groups have the advantage of making a widespread passive
attack much harder by increasing the number of groups that would have
to be exhaustively analyzed in order to recover a large number of
session keys. This contrasts with the case when only one or two
groups are ever used; in that case, one would expect that years and
years of session keys would be compromised.
There are two technical challenges to face: how can a particular user
create a unique and appropriate group, and how can a second party
assure himself that the proposed group is reasonably secure?
The security of a modular exponentiation group depends on the largest
prime factor of the group size. In order to maximize this, one can
choose "strong" or Sophie Germaine primes, P = 2Q + 1, where P and Q
are prime. However, if P = kQ + 1, where k is small, then the
strength of the group is still considerable. These groups are known
as Schnorr subgroups, and they can be found with much less
computational effort than Sophie-Germaine primes.
Schnorr subgroups can also be validated efficiently by using probable
prime tests.
It is also fairly easy to find P, k, and Q such that the largest
prime factor can be easily proven to be Q.
We estimate that it would take about 10 minutes to find a new group
of about 2^1024 elements, and this could be done once a day by a
scheduled process; validating a group proposed by a remote party
would take perhaps a minute on a 25 MHz RISC machine or a 66 MHz CISC
machine.
We note that validation is done only between previously mutually
authenticated parties, and that a new group definition always follows
and is protected by a key established using a well-known group.
There are five points to keep in mind:
a. The description and public identifier for the new group are
protected by the well-known group.
b. The responder can reject the attempt to establish the new
group, either because he is too busy or because he cannot validate
the largest prime factor as being sufficiently large.
c. The new modulus and generator can be cached for long periods of
time; they are not security critical and need not be associated
with ongoing activity.
d. Generating a new g^x value periodically will be more expensive
if there are many groups cached; however, the importance of
frequently generating new g^x values is reduced, so the time
period can be lengthened correspondingly.
e. All modular exponentiation groups have subgroups that are
weaker than the main group. For Sophie Germain primes, if the
generator is a square, then there are only two elements in the
subgroup: 1 and g^(-1) (same as g^(p-1)) which we have already
recommended avoiding. For Schnorr subgroups with k not equal to
2, the subgroup can be avoided by checking that the exponential is
not a kth root of 1 (e^k != 1 mod p).
2.8.1 Defining a New Group
This section describes how to define a new group. The description of
the group is hidden from eavesdroppers, and the identifier assigned
to the group is unique to the two parties. Use of the new group for
Diffie-Hellman key exchanges is described in the next section.
The secrecy of the description and the identifier increases the
difficulty of a passive attack, because if the group descriptor is
not known to the attacker, there is no straightforward and efficient
way to gain information about keys calculated using the group.
Only the description of the new group need be encrypted in this
exchange. The hash algorithm is implied by the OAKLEY session named
by the group. The encryption is the encryption function of the
OAKLEY session.
The descriptor of the new group is encoded in the new group payload.
The nonces are encoded in the Authentication Payload.
Data beyond the encryption boundary is encrypted using the transform
named by the KEYID.
The following messages use the ISAKMP Key Exchange Identifier OAKLEY
New Group.
To define a new modular exponentiation group:
Initiator Responder
--------- ----------
-> KEYID, ->
INEWGRP,
Desc(New Group), Na
prf(sKEYID, Desc(New Group) | Na)
<- KEYID,
INEWGRPRS,
Na, Nb
prf(sKEYID, Na | Nb | Desc(New Group)) <-
-> KEYID,
INEWGRPACK
prf(sKEYID, Nb | Na | Desc(New Group)) ->
These messages are encrypted at the encryption boundary using the key
indicated. The hash value is placed in the "digital signature" field
(see Appendix B).
New GRP identifier = trunc16(Na) | trunc16(Nb)
(trunc16 indicates truncation to 16 bits; the initiator and
responder must use nonces that have distinct upper bits from any
used for current GRPID's)
Desc(G) is the encoding of the descriptor for the group descriptor
(see Appendix A for the format of a group descriptor)
The two parties must store the mapping between the new group
identifier GRP and the group descriptor Desc(New Group). They must
also note the identities used for the KEYID and copy these to the
state for the new group.
Note that one could have the same group descriptor associated with
several KEYID's. Pre-calculation of g^x values may be done based
only on the group descriptor, not the private group name.
2.8.2 Deriving a Key Using a Private Group
Once a private group has been established, its group id can be used
in the key exchange messages in the GRP position. No changes to the
protocol are required.
2.9 Quick Mode: New Keys From Old,
When an authenticated KEYID and associated keying material sKEYID
already exist, it is easy to derive additional KEYID's and keys
sharing similar attributes (GRP, EHA, etc.) using only hashing
functions. The KEYID might be one that was derived in Main Mode, for
example.
On the other hand, the authenticated key may be a manually
distributed key, one that is shared by the initiator and responder
via some means external to OAKLEY. If the distribution method has
formed the KEYID using appropriately unique values for the two halves
(CKY-I and CKY-R), then this method is applicable.
In the following, the Key Exchange Identifier is OAKLEY Quick Mode.
The nonces are carried in the Authentication Payload, and the prf
value is carried in the Authentication Payload; the Authentication
Authority is "None" and the type is "Pre-Shared".
The protocol is:
Initiator Responder
--------- ---------
-> KEYID, INEWKRQ, Ni, prf(sKEYID, Ni) ->
<- KEYID, INEWKRS, Nr, prf(sKEYID, 1 | Nr | Ni) <-
-> KEYID, INEWKRP, 0, prf(sKEYID, 0 | Ni | Nr) ->
The New KEYID, NKEYID, is Ni | Nr
sNKEYID = prf(sKEYID, Ni | Nr )
The identities and EHA values associated with NKEYID are the same as
those associated with KEYID.
Each party must validate the hash values before using the new key for
any purpose.
2.10 Defining and Using Pre-Distributed Keys
If a key and an associated key identifier and state information have
been distributed manually, then the key can be used for any OAKLEY
purpose. The key must be associated with the usual state
information: ID's and EHA algorithms.
Local policy dictates when a manual key can be included in the OAKLEY
database. For example, only privileged users would be permitted to
introduce keys associated with privileged ID's, an unprivileged user
could only introduce keys associated with her own ID.
2.11 Distribution of an External Key
Once an OAKLEY session key and ancillary algorithms are established,
the keying material and the "H" algorithm can be used to distribute
an externally generated key and to assign a KEYID to it.
In the following, KEYID represents an existing, authenticated OAKLEY
session key, and sNEWKEYID represents the externally generated keying
material.
In the following, the Key Exchange Identifier is OAKLEY External
Mode. The Key Exchange Payload contains the new key, which is
protected
Initiator Responder
--------- ---------
-> KEYID, IEXTKEY, Ni, prf(sKEYID, Ni) ->
<- KEYID, IEXTKEY, Nr, prf(sKEYID, 1 | Nr | Ni) <-
-> KEYID, IEXTKEY, Kir xor sNEWKEYID*, prf(Kir, sNEWKEYID | Ni | Nr) ->
Kir = prf(sKEYID, Ni | Nr)
* this field is carried in the Key Exchange Payload.
Each party must validate the hash values using the "H" function in
the KEYID state before changing any key state information.
The new key is recovered by the Responder by calculating the xor of
the field in the Authentication Payload with the Kir value.
The new key identifier, naming the keying material sNEWKEYID, is
prf(sKEYID, 1 | Ni | Nr).
Note that this exchange does not require encryption. Hugo Krawcyzk
suggested the method and noted its advantage.
2.11.1 Cryptographic Strength Considerations
The strength of the key used to distribute the external key must be
at least equal to the strength of the external key. Generally, this
means that the length of the sKEYID material must be greater than or
equal to the length of the sNEWKEYID material.
The derivation of the external key, its strength or intended use are
not addressed by this protocol; the parties using the key must have
some other method for determining these properties.
As of early 1996, it appears that for 90 bits of cryptographic
strength, one should use a modular exponentiation group modulus of
2000 bits. For 128 bits of strength, a 3000 bit modulus is required.
3. Specifying and Deriving Security Associations
When a security association is defined, only the KEYID need be given.
The responder should be able to look up the state associated with the
KEYID value and find the appropriate keying material, sKEYID.
Deriving keys for use with IPSEC protocols such as ESP or AH is a
subject covered in the ISAKMP/Oakley Resolution document. That
document also describes how to negotiate acceptable parameter sets
and identifiers for ESP and AH, and how to exactly calculate the
keying material for each instance of the protocols. Because the
basic keying material defined here (g^xy) may be used to derive keys
for several instances of ESP and AH, the exact mechanics of using
one-way functions to turn g^xy into several unique keys is essential
to correct usage.
4. ISAKMP Compatibility
OAKLEY uses ISAKMP header and payload formats, as described in the
text and in Appendix B. There are particular noteworthy extensions
beyond the version 4 draft.
4.1 Authentication with Existing Keys
In the case that two parties do not have suitable public key
mechanisms in place for authenticating each other, they can use keys
that were distributed manually. After establishment of these keys
and their associated state in OAKLEY, they can be used for
authentication modes that depend on signatures, e.g. Aggressive Mode.
When an existing key is to appear in an offer list, it should be
indicated with an Authentication Algorithm of ISAKMP_EXISTING. This
value will be assigned in the ISAKMP RFC.
When the authentication method is ISAKMP_EXISTING, the authentication
authority will have the value ISAKMP_AUTH_EXISTING; the value for
this field must not conflict with any authentication authority
registered with IANA and is defined in the ISAKMP RFC.
The authentication payload will have two parts:
the KEYID for the pre-existing key
the identifier for the party to be authenticated by the pre-
existing key.
The pseudo-random function "H" in the state information for that
KEYID will be the signature algorithm, and it will use the keying
material for that key (sKEYID) when generating or checking the
validity of message data.
E.g. if the existing key has an KEYID denoted by KID and 128 bits of
keying material denoted by sKID and "H" algorithm a transform named
HMAC, then to generate a "signature" for a data block, the output of
HMAC(sKID, data) will be the corresponding signature payload.
The KEYID state will have the identities of the local and remote
parties for which the KEYID was assigned; it is up to the local
policy implementation to decide when it is appropriate to use such a
key for authenticating other parties. For example, a key distributed
for use between two Internet hosts A and B may be suitable for
authenticating all identities of the form "alice@A" and "bob@B".
4.2 Third Party Authentication
A local security policy might restrict key negotiation to trusted
parties. For example, two OAKLEY daemons running with equal
sensitivity labels on two machines might wish to be the sole arbiters
of key exchanges between users with that same sensitivity label. In
this case, some way of authenticating the provenance of key exchange
requests is needed. I.e., the identities of the two daemons should
be bound to a key, and that key will be used to form a "signature"
for the key exchange messages.
The Signature Payload, in Appendix B, is for this purpose. This
payload names a KEYID that is in existence before the start of the
current exchange. The "H" transform for that KEYID is used to
calculate an integrity/authentication value for all payloads
preceding the signature.
Local policy can dictate which KEYID's are appropriate for signing
further exchanges.
4.3 New Group Mode
OAKLEY uses a new KEI for the exchange that defines a new group.
5. Security Implementation Notes
Timing attacks that are capable of recovering the exponent value used
in Diffie-Hellman calculations have been described by Paul Kocher
[Kocher]. In order to nullify the attack, implementors must take
pains to obscure the sequence of operations involved in carrying out
modular exponentiations.
A "blinding factor" can accomplish this goal. A group element, r, is
chosen at random. When an exponent x is chosen, the value r^(-x) is
also calculated. Then, when calculating (g^y)^x, the implementation
will calculate this sequence:
A = (rg^y)
B = A^x = (rg^y)^x = (r^x)(g^(xy))
C = B*r^(-x) = (r^x)(r^-(x))(g^(xy)) = g^(xy)
The blinding factor is only necessary if the exponent x is used more
than 100 times (estimate by Richard Schroeppel).
6. OAKLEY Parsing and State Machine
There are many pathways through OAKLEY, but they follow a left-to-
right parsing pattern of the message fields.
The initiator decides on an initial message in the following order:
1. Offer a cookie. This is not necessary but it helps with
aggressive exchanges.
2. Pick a group. The choices are the well-known groups or any
private groups that may have been negotiated. The very first
exchange between two Oakley daemons with no common state must
involve a well-known group (0, meaning no group, is a well-known
group). Note that the group identifier, not the group descriptor,
is used in the message.
If a non-null group will be used, it must be included with the
first message specifying EHAO. It need not be specified until
then.
3. If PFS will be used, pick an exponent x and present g^x.
4. Offer Encryption, Hash, and Authentication lists.
5. Use PFS for hiding the identities
If identity hiding is not used, then the initiator has this
option:
6. Name the identities and include authentication information
The information in the authentication section depends on the first
authentication offer. In this aggressive exchange, the Initiator
hopes that the Responder will accept all the offered information and
the first authentication method. The authentication method
determines the authentication payload as follows:
1. Signing method. The signature will be applied to all the
offered information.
2. A public key encryption method. The algorithm will be used to
encrypt a nonce in the public key of the requested Responder
identity. There are two cases possible, depending on whether or
not identity hiding is used:
a. No identity hiding. The ID's will appear as plaintext.
b. Identity hiding. A well-known ID, call it R', will appear
as plaintext in the authentication payload. It will be
followed by two ID's and a nonce; these will be encrypted using
the public key for R'.
3. A pre-existing key method. The pre-existing key will be used
to encrypt a nonce. If identity hiding is used, the ID's will be
encrypted in place in the payload, using the "E" algorithm
associated with the pre-existing key.
The Responder can accept all, part or none of the initial message.
The Responder accepts as many of the fields as he wishes, using the
same decision order as the initiator. At any step he can stop,
implicitly rejecting further fields (which will have null values in
his response message). The minimum response is a cookie and the GRP.
1. Accept cookie. The Responder may elect to record no state
information until the Initiator successfully replies with a cookie
chosen by the responder. If so, the Responder replies with a
cookie, the GRP, and no other information.
2. Accept GRP. If the group is not acceptable, the Responder will
not reply. The Responder may send an error message indicating the
the group is not acceptable (modulus too small, unknown
identifier, etc.) Note that "no group" has two meanings during
the protocol: it may mean the group is not yet specified, or it
may mean that no group will be used (and thus PFS is not
possible).
3. Accept the g^x value. The Responder indicates his acceptance
of the g^x value by including his own g^y value in his reply. He
can postpone this by ignoring g^x and putting a zero length g^y
value in his reply. He can also reject the g^x value with an
error message.
4. Accept one element from each of the EHA lists. The acceptance
is indicated by a non-zero proposal.
5. If PFS for identity hiding is requested, then no further data
will follow.
6. If the authentication payload is present, and if the first item
in the offered authentication class is acceptable, then the
Responder must validate/decrypt the information in the
authentication payload and signature payload, if present. The
Responder should choose a nonce and reply using the same
authentication/hash algorithm as the Initiator used.
The Initiator notes which information the Responder has accepted,
validates/decrypts any signed, hashed, or encrypted fields, and if
the data is acceptable, replies in accordance to the EHA methods
selected by the Responder. The Initiator replies are distinguished
from his initial message by the presence of the non-zero value for
the Responder cookie.
The output of the signature or prf function will be encoded as a
variable precision integer as described in Appendix C. The KEYID
will indicate KEYID that names keying material and the Hash or
Signature function.
7. The Credential Payload
Useful certificates with public key information can be attached to
OAKLEY messages using Credential Payloads as defined in the ISAKMP
document. It should be noted that the identity protection option
applies to the credentials as well as the identities.
Security Considerations
The focus of this document is security; hence security considerations
permeate this memo.
Author's Address
Hilarie K. Orman
Department of Computer Science
University of Arizona
EMail: ho@darpa.mil
APPENDIX A Group Descriptors
Three distinct group representations can be used with OAKLEY. Each
group is defined by its group operation and the kind of underlying
field used to represent group elements. The three types are modular
exponentiation groups (named MODP herein), elliptic curve groups over
the field GF[2^N] (named EC2N herein), and elliptic curve groups over
GF[P] (named ECP herein) For each representation, many distinct
realizations are possible, depending on parameter selection.
With a few exceptions, all the parameters are transmitted as if they
were non-negative multi-precision integers, using the format defined
in this appendix (note, this is distinct from the encoding in
Appendix C). Every multi-precision integer has a prefixed length
field, even where this information is redundant.
For the group type EC2N, the parameters are more properly thought of
as very long bit fields, but they are represented as multi-precision
integers, (with length fields, and right-justified). This is the
natural encoding.
MODP means the classical modular exponentiation group, where the
operation is to calculate G^X (mod P). The group is defined by the
numeric parameters P and G. P must be a prime. G is often 2, but
may be a larger number. 2 <= G <= P-2.
ECP is an elliptic curve group, modulo a prime number P. The
defining equation for this kind of group is
Y^2 = X^3 + AX + B The group operation is taking a multiple of an
elliptic-curve point. The group is defined by 5 numeric parameters:
The prime P, two curve parameters A and B, and a generator (X,Y).
A,B,X,Y are all interpreted mod P, and must be (non-negative)
integers less than P. They must satisfy the defining equation,
modulo P.
EC2N is an elliptic curve group, over the finite field F[2^N]. The
defining equation for this kind of group is
Y^2 + XY = X^3 + AX^2 + B (This equation differs slightly from the
mod P case: it has an XY term, and an AX^2 term instead of an AX
term.)
We must specify the field representation, and then the elliptic
curve. The field is specified by giving an irreducible polynomial
(mod 2) of degree N. This polynomial is represented as an integer of
size between 2^N and 2^(N+1), as if the defining polynomial were
evaluated at the value U=2.
For example, the field defined by the polynomial U^155 + U^62 + 1 is
represented by the integer 2^155 + 2^62 + 1. The group is defined by
4 more parameters, A,B,X,Y. These parameters are elements of the
field GF[2^N], and can be thought of as polynomials of degree < N,
with (mod 2) coefficients. They fit in N-bit fields, and are
represented as integers < 2^N, as if the polynomial were evaluated at
U=2. For example, the field element U^2 + 1 would be represented by
the integer 2^2+1, which is 5. The two parameters A and B define the
curve. A is frequently 0. B must not be 0. The parameters X and Y
select a point on the curve. The parameters A,B,X,Y must satisfy the
defining equation, modulo the defining polynomial, and mod 2.
Group descriptor formats:
Type of group: A two-byte field,
assigned values for the types "MODP", "ECP", "EC2N"
will be defined (see ISAKMP-04).
Size of a field element, in bits. This is either Ceiling(log2 P)
or the degree of the irreducible polynomial: a 32-bit integer.
The prime P or the irreducible field polynomial: a multi-precision
integer.
The generator: 1 or 2 values, multi-precision integers.
EC only: The parameters of the curve: 2 values, multi-precision
integers.
The following parameters are Optional (each of these may appear
independently):
a value of 0 may be used as a place-holder to represent an unspecified
parameter; any number of the parameters may be sent, from 0 to 3.
The largest prime factor: the encoded value that is the LPF of the
group size, a multi-precision integer.
EC only: The order of the group: multi-precision integer.
(The group size for MODP is always P-1.)
Strength of group: 32-bit integer.
The strength of the group is approximately the number of key-bits
protected.
It is determined by the log2 of the effort to attack the group.
It may change as we learn more about cryptography.
This is a generic example for a "classic" modular exponentiation group:
Group type: "MODP"
Size of a field element in bits: Log2 (P) rounded *up*. A 32bit
integer.
Defining prime P: a multi-precision integer.
Generator G: a multi-precision integer. 2 <= G <= P-2.
<optional>
Largest prime factor of P-1: the multi-precision integer Q
Strength of group: a 32-bit integer. We will specify a formula
for calculating this number (TBD).
This is a generic example for an elliptic curve group, mod P:
Group type: "ECP"
Size of a field element in bits: Log2 (P) rounded *up*,
a 32 bit integer.
Defining prime P: a multi-precision integer.
Generator (X,Y): 2 multi-precision integers, each < P.
Parameters of the curve A,B: 2 multi-precision integers, each < P.
<optional>
Largest prime factor of the group order: a multi-precision integer.
Order of the group: a multi-precision integer.
Strength of group: a 32-bit integer. Formula TBD.
This is a specific example for an elliptic curve group:
Group type: "EC2N"
Degree of the irreducible polynomial: 155
Irreducible polynomial: U^155 + U^62 + 1, represented as the
multi-precision integer 2^155 + 2^62 + 1.
Generator (X,Y) : represented as 2 multi-precision integers, each
< 2^155.
For our present curve, these are (decimal) 123 and 456. Each is
represented as a multi-precision integer.
Parameters of the curve A,B: represented as 2 multi-precision
integers, each < 2^155.
For our present curve these are 0 and (decimal) 471951, represented
as two multi-precision integers.
<optional>
Largest prime factor of the group order:
3805993847215893016155463826195386266397436443,
represented as a multi-precision integer.
The order of the group:
45671926166590716193865565914344635196769237316
represented as a multi-precision integer.
Strength of group: 76, represented as a 32-bit integer.
The variable precision integer encoding for group descriptor fields
is the following. This is a slight variation on the format defined
in Appendix C in that a fixed 16-bit value is used first, and the
length is limited to 16 bits. However, the interpretation is
otherwise identical.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Fixed value (TBD) ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. Integer .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of a group descriptor is:
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!1! Group Description ! MODP !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Field Size ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Prime ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Generator1 ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Generator2 ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Curve-p1 ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Curve-p2 ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Largest Prime Factor ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!1!0! Order of Group ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!0!0! Strength of Group ! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! MPI !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
APPENDIX B Message formats
The encodings of Oakley messages into ISAKMP payloads is deferred to
the ISAKMP/Oakley Resolution document.
APPENDIX C Encoding a variable precision integer.
Variable precision integers will be encoded as a 32-bit length field
followed by one or more 32-bit quantities containing the
representation of the integer, aligned with the most significant bit
in the first 32-bit item.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! first value word (most significant bits) !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! !
~ additional value words ~
! !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
An example of such an encoding is given below, for a number with 51
bits of significance. The length field indicates that 2 32-bit
quantities follow. The most significant non-zero bit of the number
is in bit 13 of the first 32-bit quantity, the low order bits are in
the second 32-bit quantity.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! 1 0!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!0 0 0 0 0 0 0 0 0 0 0 0 0 1 x x x x x x x x x x x x x x x x x x!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
APPENDIX D Cryptographic strengths
The Diffie-Hellman algorithm is used to compute keys that will be
used with symmetric algorithms. It should be no easier to break the
Diffie-Hellman computation than it is to do an exhaustive search over
the symmetric key space. A recent recommendation by an group of
cryptographers [Blaze] has recommended a symmetric key size of 75
bits for a practical level of security. For 20 year security, they
recommend 90 bits.
Based on that report, a conservative strategy for OAKLEY users would
be to ensure that their Diffie-Hellman computations were as secure as
at least a 90-bit key space. In order to accomplish this for modular
exponentiation groups, the size of the largest prime factor of the
modulus should be at least 180 bits, and the size of the modulus
should be at least 1400 bits. For elliptic curve groups, the LPF
should be at least 180 bits.
If long-term secrecy of the encryption key is not an issue, then the
following parameters may be used for the modular exponentiation
group: 150 bits for the LPF, 980 bits for the modulus size.
The modulus size alone does not determine the strength of the
Diffie-Hellman calculation; the size of the exponent used in
computing powers within the group is also important. The size of the
exponent in bits should be at least twice the size of any symmetric
key that will be derived from it. We recommend that ISAKMP
implementors use at least 180 bits of exponent (twice the size of a
20-year symmetric key).
The mathematical justification for these estimates can be found in
texts that estimate the effort for solving the discrete log problem,
a task that is strongly related to the efficiency of using the Number
Field Sieve for factoring large integers. Readers are referred to
[Stinson] and [Schneier].
APPENDIX E The Well-Known Groups
The group identifiers:
0 No group (used as a placeholder and for non-DH exchanges)
1 A modular exponentiation group with a 768 bit modulus
2 A modular exponentiation group with a 1024 bit modulus
3 A modular exponentiation group with a 1536 bit modulus (TBD)
4 An elliptic curve group over GF[2^155]
5 An elliptic curve group over GF[2^185]
values 2^31 and higher are used for private group identifiers
Richard Schroeppel performed all the mathematical and computational
work for this appendix.
Classical Diffie-Hellman Modular Exponentiation Groups
The primes for groups 1 and 2 were selected to have certain
properties. The high order 64 bits are forced to 1. This helps the
classical remainder algorithm, because the trial quotient digit can
always be taken as the high order word of the dividend, possibly +1.
The low order 64 bits are forced to 1. This helps the Montgomery-
style remainder algorithms, because the multiplier digit can always
be taken to be the low order word of the dividend. The middle bits
are taken from the binary expansion of pi. This guarantees that they
are effectively random, while avoiding any suspicion that the primes
have secretly been selected to be weak.
Because both primes are based on pi, there is a large section of
overlap in the hexadecimal representations of the two primes. The
primes are chosen to be Sophie Germain primes (i.e., (P-1)/2 is also
prime), to have the maximum strength against the square-root attack
on the discrete logarithm problem.
The starting trial numbers were repeatedly incremented by 2^64 until
suitable primes were located.
Because these two primes are congruent to 7 (mod 8), 2 is a quadratic
residue of each prime. All powers of 2 will also be quadratic
residues. This prevents an opponent from learning the low order bit
of the Diffie-Hellman exponent (AKA the subgroup confinement
problem). Using 2 as a generator is efficient for some modular
exponentiation algorithms. [Note that 2 is technically not a
generator in the number theory sense, because it omits half of the
possible residues mod P. From a cryptographic viewpoint, this is a
virtue.]
E.1. Well-Known Group 1: A 768 bit prime
The prime is 2^768 - 2^704 - 1 + 2^64 * { [2^638 pi] + 149686 }. Its
decimal value is
155251809230070893513091813125848175563133404943451431320235
119490296623994910210725866945387659164244291000768028886422
915080371891804634263272761303128298374438082089019628850917
0691316593175367469551763119843371637221007210577919
This has been rigorously verified as a prime.
The representation of the group in OAKLEY is
Type of group: "MODP"
Size of field element (bits): 768
Prime modulus: 21 (decimal)
Length (32 bit words): 24
Data (hex):
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF
Generator: 22 (decimal)
Length (32 bit words): 1
Data (hex): 2
Optional Parameters:
Group order largest prime factor: 24 (decimal)
Length (32 bit words): 24
Data (hex):
7FFFFFFF FFFFFFFF E487ED51 10B4611A 62633145 C06E0E68
94812704 4533E63A 0105DF53 1D89CD91 28A5043C C71A026E
F7CA8CD9 E69D218D 98158536 F92F8A1B A7F09AB6 B6A8E122
F242DABB 312F3F63 7A262174 D31D1B10 7FFFFFFF FFFFFFFF
Strength of group: 26 (decimal)
Length (32 bit words) 1
Data (hex):
00000042
E.2. Well-Known Group 2: A 1024 bit prime
The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }.
Its decimal value is
179769313486231590770839156793787453197860296048756011706444
423684197180216158519368947833795864925541502180565485980503
646440548199239100050792877003355816639229553136239076508735
759914822574862575007425302077447712589550957937778424442426
617334727629299387668709205606050270810842907692932019128194
467627007
The primality of the number has been rigorously proven.
The representation of the group in OAKLEY is
Type of group: "MODP"
Size of field element (bits): 1024
Prime modulus: 21 (decimal)
Length (32 bit words): 32
Data (hex):
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381
FFFFFFFF FFFFFFFF
Generator: 22 (decimal)
Length (32 bit words): 1
Data (hex): 2
Optional Parameters:
Group order largest prime factor: 24 (decimal)
Length (32 bit words): 32
Data (hex):
7FFFFFFF FFFFFFFF E487ED51 10B4611A 62633145 C06E0E68
94812704 4533E63A 0105DF53 1D89CD91 28A5043C C71A026E
F7CA8CD9 E69D218D 98158536 F92F8A1B A7F09AB6 B6A8E122
F242DABB 312F3F63 7A262174 D31BF6B5 85FFAE5B 7A035BF6
F71C35FD AD44CFD2 D74F9208 BE258FF3 24943328 F67329C0
FFFFFFFF FFFFFFFF
Strength of group: 26 (decimal)
Length (32 bit words) 1
Data (hex):
0000004D
E.3. Well-Known Group 3: An Elliptic Curve Group Definition
The curve is based on the Galois field GF[2^155] with 2^155 field
elements. The irreducible polynomial for the field is u^155 + u^62 +
1. The equation for the elliptic curve is
Y^2 + X Y = X^3 + A X + B
X, Y, A, B are elements of the field.
For the curve specified, A = 0 and
B = u^18 + u^17 + u^16 + u^13 + u^12 + u^9 + u^8 + u^7 + u^3 + u^2 +
u + 1.
B is represented in binary as the bit string 1110011001110001111; in
decimal this is 471951, and in hex 7338F.
The generator is a point (X,Y) on the curve (satisfying the curve
equation, mod 2 and modulo the field polynomial).
X = u^6 + u^5 + u^4 + u^3 + u + 1
and
Y = u^8 + u^7 + u^6 + u^3.
The binary bit strings for X and Y are 1111011 and 111001000; in
decimal they are 123 and 456.
The group order (the number of curve points) is
45671926166590716193865565914344635196769237316
which is 12 times the prime
3805993847215893016155463826195386266397436443.
(This prime has been rigorously proven.) The generating point (X,Y)
has order 4 times the prime; the generator is the triple of some
curve point.
OAKLEY representation of this group:
Type of group: "EC2N"
Size of field element (bits): 155
Irreducible field polynomial: 21 (decimal)
Length (32 bit words): 5
Data (hex):
08000000 00000000 00000000 40000000 00000001
Generator:
X coordinate: 22 (decimal)
Length (32 bit words): 1
Data (hex): 7B
Y coordinate: 22 (decimal)
Length (32 bit words): 1
Data (hex): 1C8
Elliptic curve parameters:
A parameter: 23 (decimal)
Length (32 bit words): 1
Data (hex): 0
B parameter: 23 (decimal)
Length (32 bit words): 1
Data (hex): 7338F
Optional Parameters:
Group order largest prime factor: 24 (decimal)
Length (32 bit words): 5
Data (hex):
00AAAAAA AAAAAAAA AAAAB1FC F1E206F4 21A3EA1B
Group order: 25 (decimal)
Length (32 bit words): 5
Data (hex):
08000000 00000000 000057DB 56985371 93AEF944
Strength of group: 26 (decimal)
Length (32 bit words) 1
Data (hex):
0000004C
E.4. Well-Known Group 4: A Large Elliptic Curve Group Definition
This curve is based on the Galois field GF[2^185] with 2^185 field
elements. The irreducible polynomial for the field is
u^185 + u^69 + 1.
The equation for the elliptic curve is
Y^2 + X Y = X^3 + A X + B.
X, Y, A, B are elements of the field. For the curve specified, A = 0
and
B = u^12 + u^11 + u^10 + u^9 + u^7 + u^6 + u^5 + u^3 + 1.
B is represented in binary as the bit string 1111011101001; in
decimal this is 7913, and in hex 1EE9.
The generator is a point (X,Y) on the curve (satisfying the curve
equation, mod 2 and modulo the field polynomial);
X = u^4 + u^3 and Y = u^3 + u^2 + 1.
The binary bit strings for X and Y are 11000 and 1101; in decimal
they are 24 and 13. The group order (the number of curve points) is
49039857307708443467467104857652682248052385001045053116,
which is 4 times the prime
12259964326927110866866776214413170562013096250261263279.
(This prime has been rigorously proven.)
The generating point (X,Y) has order 2 times the prime; the generator
is the double of some curve point.
OAKLEY representation of this group:
Type of group: "EC2N"
Size of field element (bits): 185
Irreducible field polynomial: 21 (decimal)
Length (32 bit words): 6
Data (hex):
02000000 00000000 00000000 00000020 00000000 00000001
Generator:
X coordinate: 22 (decimal)
Length (32 bit words): 1
Data (hex): 18
Y coordinate: 22 (decimal)
Length (32 bit words): 1
Data (hex): D
Elliptic curve parameters:
A parameter: 23 (decimal)
Length (32 bit words): 1
Data (hex): 0
B parameter: 23 (decimal)
Length (32 bit words): 1
Data (hex): 1EE9
Optional parameters:
Group order largest prime factor: 24 (decimal)
Length (32 bit words): 6
Data (hex):
007FFFFF FFFFFFFF FFFFFFFF F6FCBE22 6DCF9210 5D7E53AF
Group order: 25 (decimal)
Length (32 bit words): 6
Data (hex):
01FFFFFF FFFFFFFF FFFFFFFF DBF2F889 B73E4841 75F94EBC
Strength of group: 26 (decimal)
Length (32 bit words) 1
Data (hex):
0000005B
E.5. Well-Known Group 5: A 1536 bit prime
The prime is 2^1536 - 2^1472 - 1 + 2^64 * { [2^1406 pi] + 741804
}.
Its decimal value is
241031242692103258855207602219756607485695054850245994265411
694195810883168261222889009385826134161467322714147790401219
650364895705058263194273070680500922306273474534107340669624
601458936165977404102716924945320037872943417032584377865919
814376319377685986952408894019557734611984354530154704374720
774996976375008430892633929555996888245787241299381012913029
459299994792636526405928464720973038494721168143446471443848
8520940127459844288859336526896320919633919
The primality of the number has been rigorously proven.
The representation of the group in OAKLEY is
Type of group: "MODP"
Size of field element (bits): 1536
Prime modulus: 21 (decimal)
Length (32 bit words): 48
Data (hex):
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE45B3D
C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 FD24CF5F
83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D
670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF
Generator: 22 (decimal)
Length (32 bit words): 1
Data (hex): 2
Optional Parameters:
Group order largest prime factor: 24 (decimal)
Length (32 bit words): 48
Data (hex):
7FFFFFFF FFFFFFFF E487ED51 10B4611A 62633145 C06E0E68
94812704 4533E63A 0105DF53 1D89CD91 28A5043C C71A026E
F7CA8CD9 E69D218D 98158536 F92F8A1B A7F09AB6 B6A8E122
F242DABB 312F3F63 7A262174 D31BF6B5 85FFAE5B 7A035BF6
F71C35FD AD44CFD2 D74F9208 BE258FF3 24943328 F6722D9E
E1003E5C 50B1DF82 CC6D241B 0E2AE9CD 348B1FD4 7E9267AF
C1B2AE91 EE51D6CB 0E3179AB 1042A95D CF6A9483 B84B4B36
B3861AA7 255E4C02 78BA3604 6511B993 FFFFFFFF FFFFFFFF
Strength of group: 26 (decimal)
Length (32 bit words) 1
Data (hex):
0000005B
Appendix F Implementing Group Operations
The group operation must be implemented as a sequence of arithmetic
operations; the exact operations depend on the type of group. For
modular exponentiation groups, the operation is multi-precision
integer multiplication and remainders by the group modulus. See
Knuth Vol. 2 [Knuth] for a discussion of how to implement these for
large integers. Implementation recommendations for elliptic curve
group operations over GF[2^N] are described in [Schroeppel].
BIBLIOGRAPHY
[RFC2401] Atkinson, R., "Security Architecture for the
Internet Protocol", RFC2401, November 1998.
[RFC2406] Atkinson, R., "IP Encapsulating Security Payload (ESP)",