21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Let the salt be public, in which case the attacker can try out passwords by<br />

attempting to authenticate with the server.<br />

The server<br />

The first thing the server needs to be able to do is create accounts for users. User credential<br />

information is stored in objects of type AX_CRED. To compute credentials, use<br />

the following function:<br />

void AX_compute_credentials(char *user, size_t ulen, char *pass, size_t plen,<br />

size_t ic, size_t pksz, size_t minkl, size_t maxkl,<br />

size_t public_salt, size_t saltlen, AX_CRED *out);<br />

This function has the following arguments:<br />

user<br />

Arbitrary binary string representing the unique login ID of the user.<br />

ulen<br />

Length of the username.<br />

pass<br />

The password, an arbitrary binary string.<br />

plen<br />

Length of the password in bytes.<br />

ic<br />

Iteration count to be used in the internal secret derivation function. See Recipe 4.10<br />

for recommendations on setting this value (AX uses the derivation function from<br />

that recipe).<br />

pksz<br />

Determines whether PAX credentials or SAX credentials should be computed. If<br />

you are using PAX, the value specifies the length of the modulus of the public<br />

key in bits, which must be 1,024, 2,048, 4,096, or 8,192. If you are using SAX,<br />

set this value to 0.<br />

minkl<br />

Minimum key length we will allow the client to request when doing an<br />

exchange, in bytes. We recommend 16 bytes (128 bits).<br />

maxkl<br />

Maximum key length we will allow the client to request when doing an<br />

exchange, in bytes. Often, the protocol you use will only want a single fixed-size<br />

key (and not give the client the option to choose), in which case, this should be<br />

the same value as minkl.<br />

public_salt<br />

If this is nonzero, the server will give out the user’s salt value when requested.<br />

Otherwise, the server should print out the salt at account creation time and have<br />

the user enter it on first login from a new client machine.<br />

Performing Password-Based Authentication and Key Exchange | 423<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!