diff options
author | lloyd <[email protected]> | 2008-06-27 20:21:45 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-27 20:21:45 +0000 |
commit | 3d0a9fd636e5ca91fcf8f5c0e13dcf659940b564 (patch) | |
tree | 4ce02817eac4c55b27cc75106adce227b4461220 /doc/examples/encrypt.cpp | |
parent | 964dbc067992211e7d566c881de2c7330f46bef2 (diff) |
Update more of the examples
Diffstat (limited to 'doc/examples/encrypt.cpp')
-rw-r--r-- | doc/examples/encrypt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/examples/encrypt.cpp b/doc/examples/encrypt.cpp index 5b8ae8684..8d0636c35 100644 --- a/doc/examples/encrypt.cpp +++ b/doc/examples/encrypt.cpp @@ -121,9 +121,11 @@ int main(int argc, char* argv[]) const u32bit key_len = max_keylength_of(algo); const u32bit iv_len = block_size_of(algo); + std::auto_ptr<RandomNumberGenerator> rng(make_rng()); + std::auto_ptr<S2K> s2k(get_s2k("PBKDF2(SHA-1)")); s2k->set_iterations(8192); - s2k->new_random_salt(8); + s2k->new_random_salt(*rng, 8); SymmetricKey bc_key = s2k->derive_key(key_len, "BLK" + passphrase); InitializationVector iv = s2k->derive_key(iv_len, "IVL" + passphrase); |