diff options
author | lloyd <[email protected]> | 2014-01-01 21:49:13 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-01 21:49:13 +0000 |
commit | ba238d04531a4e76ed88635871fd82e5459b3cc4 (patch) | |
tree | 5de580b3b43b68c93dc3f5268538066d3c75c2aa /doc | |
parent | 9f9811125846fb7fce6bec8c8439894bd43e6ace (diff) |
Move bcrypt example to run from test app
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/bcrypt.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/doc/examples/bcrypt.cpp b/doc/examples/bcrypt.cpp deleted file mode 100644 index 4154b26ad..000000000 --- a/doc/examples/bcrypt.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include <botan/botan.h> -#include <botan/bcrypt.h> -#include <iostream> - -using namespace Botan; - -int main(int argc, char* argv[]) - { - if(argc != 2 && argc != 3) - { - std::cout << "Usage: " << argv[0] << " password\n" - << " " << argv[0] << " password passhash\n"; - return 1; - } - - LibraryInitializer init; - - if(argc == 2) - { - AutoSeeded_RNG rng; - - std::cout << generate_bcrypt(argv[1], rng, 12) << "\n"; - } - else if(argc == 3) - { - if(strlen(argv[2]) != 60) - { - std::cout << "Note: hash " << argv[2] - << " has wrong length and cannot be valid\n"; - } - - const bool ok = check_bcrypt(argv[1], argv[2]); - - std::cout << "Password is " << (ok ? "valid" : "NOT valid") << "\n"; - } - - return 0; - } |