aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/encrypt.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-27 20:21:45 +0000
committerlloyd <[email protected]>2008-06-27 20:21:45 +0000
commit3d0a9fd636e5ca91fcf8f5c0e13dcf659940b564 (patch)
tree4ce02817eac4c55b27cc75106adce227b4461220 /doc/examples/encrypt.cpp
parent964dbc067992211e7d566c881de2c7330f46bef2 (diff)
Update more of the examples
Diffstat (limited to 'doc/examples/encrypt.cpp')
-rw-r--r--doc/examples/encrypt.cpp4
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);