Skip to content

Commit a32f104

Browse files
author
Rahul Chatterjee
committed
Updated the README
1 parent 009ff2d commit a32f104

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ For compiling the project from source, you need following libraries.
88
* `cmake >= 3.6`
99
* Depends on Google `protobuf`
1010
* Includes `cryptopp`, `zxcvbn` and `plog` (inside)
11-
* pam-dev (in future)
11+
* `pam-dev`
12+
* `cURL` (in debian install `libcurl4-openssl-dev`)
13+
1214

1315
## Compile/Build
1416
```bash
@@ -23,16 +25,26 @@ eventually. Trust me!
2325

2426
You can package, or just install directly by running, `sudo make isntall`.
2527
If you install using `make install`, don't forget to run, `sudo ./script/postinst`.
28+
```bash
29+
# Installation steps
30+
$ cd build
31+
$ sudo ./script/preinst
32+
$ sudo make install
33+
$ sudo ./script/postinst
34+
```
35+
2636

2737
I would suggest creating the package and then install it using your favorite
2838
package manager. TO build your own pacakge you have to change the
2939
`CPACK_GENERATOR` in `install/CMakeList.txt` to what you like, possible options
3040
are, `DEB`, `RPM`, `STGZ` etc. (I am confusing the hell out of you. I know. I am
3141
confused too.)
3242

43+
You can see your existing log, number of typos etc. using the `typtop` binary
44+
installed in your `/usr/local/bin`. Try `$ typtop` and it will show you the options.
45+
3346

34-
### TODO:
35-
[See Todo](./todo.md)
47+
### TODO: [See Todo](./todo.md)
3648

3749
## Some useful resources
3850
* MAC packaging guide: https://matthew-brett.github.io/docosx/flat_packages.html

src/typtop.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,15 @@ void TypTop::initialize(const string &real_pw) {
205205
void TypTop::insert_into_log(const string &pw, bool in_cache, time_t ts) {
206206
assert(!real_pw.empty());
207207
float _this_pw_ent = entropy(pw);
208+
int len = pw.size();
209+
// Why 10, that's the 3-quartile of RockYou dataset with passwords>6.
210+
int pass_complexity = (len>10 || _this_pw_ent>32)?1:0;
208211
Log *l = db.mutable_logs()->add_l();
209212
l->set_in_cache(in_cache);
210213
l->set_istop5fixable(top5fixable(real_pw, pw));
211214
l->set_edit_dist(min(edit_distance(pw, real_pw), 5));
212215
l->set_rel_entropy(_this_pw_ent - ench.pw_ent());
213-
l->set_pass_complexity(_this_pw_ent>20?1:0);
216+
l->set_pass_complexity(pass_complexity);
214217
SecByteBlock g_salt((const byte *) db.ch().global_salt().data(), db.ch().global_salt().size());
215218
l->set_tid(compute_id(g_salt, pw));
216219
l->set_ts((int64_t)ts);

0 commit comments

Comments
 (0)