diff options
author | lloyd <[email protected]> | 2011-04-04 03:43:52 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-04 03:43:52 +0000 |
commit | 3b9bfbd07c3723662832caf5b1efe04de28b656d (patch) | |
tree | ee2a9324f384efead6e5bb87ac8374e7e8734c90 /doc/examples/bcrypt.cpp | |
parent | 04db054f1ae8de572ee9c0cfe227e76f84096bd6 (diff) |
Convert most of the documentation to reStructured Text, adding
a makefile to build it with Sphinx (http://sphinx.pocoo.org/).
Previously credits.txt listed public domain code sources; instead
directly credit the authors in the relevant files and delete that
file.
Drop the draft FIPS 140 security policy; I can't imagine FIPS 140
validation will ever happen, and if it does, I don't want
anything to do with it.
Also drop the internals doc, which was so out of date (and
incomplete) as to be worthless.
Move the tutorials and InSiTo pdfs into old/ for the time being,
until anything relevant from them can be filtered out and
converted into RST.
Diffstat (limited to 'doc/examples/bcrypt.cpp')
-rw-r--r-- | doc/examples/bcrypt.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/doc/examples/bcrypt.cpp b/doc/examples/bcrypt.cpp deleted file mode 100644 index 27a98cf33..000000000 --- a/doc/examples/bcrypt.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Bcrypt example -* (C) 2011 Jack Lloyd -* -* Distributed under the terms of the Botan license -*/ - -#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; - } |