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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

void<br />

C.add keys in file(const char ∗ file name)<br />

adds the key(s) in the given file to the key list.<br />

void C.clear keys( ) removes all keys.<br />

4. Example<br />

Example on how to use CryptAutoDecoder with a key file:<br />

typedef OFBCoder Cipher;<br />

// generate key ...<br />

CryptByteString passphrase("secret phrase");<br />

CryptByteString dummy_salt; // will be ignored<br />

CryptKey key<br />

= CryptKey::generate_key_and_salt(16, 16, passphrase, dummy_salt, true);<br />

// 8*16 = 128 bit salt and key<br />

// write key<br />

ofstream key_out("secret.key");<br />

key_out set_key(key);<br />

data_out

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

Saved successfully!

Ooh no, something went wrong!