31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

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.

CryptKey<br />

CryptByteString<br />

CryptKey<br />

CryptByteString<br />

CryptKey :: generate key(uint16 key size,<br />

const CryptByteString& passphrase,<br />

const CryptByteString& salt =<br />

CryptByteString( ),<br />

uint32 num iterations = 4096)<br />

generates a key from a passphrase and a salt. <strong>The</strong><br />

seed for the generation is simply passphrase ◦salt.<br />

CryptKey :: generate salt(uint16 salt size)<br />

generates a salt as follows: If salt size is at least<br />

sizeof(date)+4 then a representation of the current<br />

date is stored in the last sizeof(date) bytes<br />

of the salt. <strong>The</strong> remaining bytes are filled with<br />

pseudo-random numbers from a generator which<br />

is initialized with the current time.<br />

CryptKey :: generate key and salt(uint16 key size, uint16 salt size,<br />

const CryptByteString& passphrase,<br />

CryptByteString& salt,<br />

uint32 num iterations = 4096)<br />

first some salt is generated (see above); then a<br />

key is generated from this salt and the given<br />

passphrase.<br />

CryptKey :: read passphrase(const string& prompt,<br />

uint16 min length = 6)<br />

writes the prompt to stdout and then reads a<br />

passphrase from stdin until a phrase with the<br />

specified minimum length is entered. (While the<br />

phrase is read stdin is put into unbuffered mode.)

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

Saved successfully!

Ooh no, something went wrong!