diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-24 13:49:51 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-09-24 13:49:51 -0700 |
commit | 6f6524a878d98086c91b91a32e0996fb4e2bafb1 (patch) | |
tree | 7bafc48312c747a99f9fe7b6980f8bb04a434e0b | |
parent | c758a3ca08604b2563a985f862da34652604a85e (diff) | |
download | zxcvbn-c-6f6524a878d98086c91b91a32e0996fb4e2bafb1.tar.gz |
patch & install README and usage example
-rw-r--r-- | debian/patches/patch-README-for-Debian.patch | 42 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/zxcvbn-dev.docs | 1 | ||||
-rw-r--r-- | debian/zxcvbn-dev.examples | 1 |
4 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches/patch-README-for-Debian.patch b/debian/patches/patch-README-for-Debian.patch new file mode 100644 index 0000000..c408ee3 --- /dev/null +++ b/debian/patches/patch-README-for-Debian.patch @@ -0,0 +1,42 @@ +From: Sean Whitton <spwhitton@spwhitton.name> +Date: Sat, 24 Sep 2016 13:46:46 -0700 +Subject: patch README for Debian + +--- + README.md | 19 +------------------ + 1 file changed, 1 insertion(+), 18 deletions(-) + +diff --git a/README.md b/README.md +index e42b001..b5fa5bc 100644 +--- a/README.md ++++ b/README.md +@@ -9,28 +9,11 @@ The original coffee script version is available at + An article on the reasons for zxcvbn is at + https://tech.dropox.com/2012/04/zxcvbn-realistic-password-strength-estimation + +-##Building +- +-The makefile will build several test programs to test the code. It shows the steps needed to use the code in C and C++ programs, using the dictionary data read from file or included within the program executable. +-The makefile has only been tried on Linux using GCC version 4.8.4, but should be faily portable to other systems. +- +-When dictionary data is included in your program's executable, the files `zxcvbn.c` , `zxcvbn.h` , `dict-src.h` are used in your program. +- +-When dictionary data is read from file, the files `zxcvbn.c` , `zxcvbn.h` , `dict-crc.h` and `zxcvbn.dict` are used in your program, compiled with `#define USE_DICT_FILE`. The CRC of the dictionary data file is written to `dict-crc.h` so your executable can detect corruption of the data. +- +-Rename `zxcvbn.c` to `zxcvbn.cpp` (or whatever your compiler uses) to compile as C++. +- +-The `dict*.h` and `zxcvbn.dict` files are generated by the dictgen program compiled from dict-generate.cpp (see makefile for details). +- + ##Using + +-Initially call `ZxcvbnInit()` with the pathname of the `zxcvbn.dict` file. This can be omitted when dictionary data is included in the executable. +- + Call `ZxcvbnMatch()` with the password and optional user dictionary to get the entropy estimation and optional information on the password parts (which will need freeing with `ZxcvbnFreeInfo()` after use). Do this for each password to be tested, or as each character of it is entered into your program. The optional user dictionary can change between each call. + +-Finally call `ZxcvbnUninit()` to free the dictionary data from read from file. This can be omitted when dictionary data is included in the executable. +- +-Review the test program in `test.c` for an example. ++Review the test program in `examples/test.c` for an example. + + + ## Differences from the original version. diff --git a/debian/patches/series b/debian/patches/series index 30e0084..eab4d2c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ conditionally-define-CFLAGS.patch angled-include-zxcvbn.h.patch +patch-README-for-Debian.patch targets-to-build-shlib.patch diff --git a/debian/zxcvbn-dev.docs b/debian/zxcvbn-dev.docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/zxcvbn-dev.docs @@ -0,0 +1 @@ +README.md diff --git a/debian/zxcvbn-dev.examples b/debian/zxcvbn-dev.examples new file mode 100644 index 0000000..609859b --- /dev/null +++ b/debian/zxcvbn-dev.examples @@ -0,0 +1 @@ +test.c |