MIGP (Might I Get Pwned) is a next-generation password breach altering service to prevent users from picking passwords that are very similar to their prior leaked passwords; such credentials are vulnerable to credential tweaking attacks. This repository contains the code we used for the security simulations and performance analysis of MIGP. The paper is published in USENIX Security 2022. For details please refer to our paper.
[Disclaimer] This repository is a proof-of-concept prototype. Please review it carefully before using it for any purposes.
- For crypto operations on
secp256k
, we used petlib library, and for expensive hashing we used
this argon2 implementation. Please installpetlib
following the instructions from here. - All required packages are listed in the
requirements.txt
file. We encourage creating virtual environments before running the experiments (usingconda
orvirtualenv
). WR_19
andWR_20
relies on Go (version 1.15 is the one we experimented with).
Since the files required to run the experiments are sensitive password leaks from 2019, if you need access to datasets please write to us. We can grant access to datasets after properly reviewing the request.
Training the Pass2Path models is computationally expensive. Therefore, we trained these models in GPU and generated the prediction files for required test_files, to run the experiments fast. The code for training the Pass2Path models is in "https://github.com/Bijeeta/credtweak/tree/master/credTweakAttack/". We also stored the sorted list of rules for Das-R and EDR models, ranked based on the breached dataset.
To generate the values of fig4, run bash fig4.sh
To generate the values of fig5, run bash fig5.sh
To generate the values of fig6, run bash fig6.sh
Security simulation is computationally expensive. Some of the simulations may took days. Therefore it is separated into three phases. The output of the one phase is saved as NumPy arrays and used in the next phases.
bash script_step_1.sh
. // This will create password variations. You can skip this one as we already provide the variations file insidedata_files
folderbash script_step_2.sh
. // This creates the top 10^3 guess ranks. We have also generated the guess ranks and balls of each password in thedata_files
folder. [skip if you want]- Finally, run
bash script_step_3.sh <n> <qc>
to generate the row corresponding to row with valuen
andqc
in Figure 8. The results will be saved inresults/security_sumulation.tsv
file. This part may long time as for n =100 and q_c=10^3 it took us 12 hours to complete the simulation. - After the step 3 has been done for each
n
andqc
, runpython3.8 Figure 8.py
. It should generate Figure 8. If some values forn
andqc
the values have not been generated it will show blank.
- MIGP Server: Navigate to the
performance_simulation/MIGP_server
directory in the terminal and enterpython3 MIGP_server.py
. By default, rate-limiting protection is off and prefix length 20 is used. To run the server with rate-limiting option enter:python3 MIGP_server.py --rate_limitaintg 1
- MIGP Client: After the server has completed preloading open a new terminal, navigate to
performance_simulation/MIGP_server
and type the following commandspython3 post_client_MIGP.py --username <username> --password <password to check> --prefix_length <prefix_length set on the server> --rate_limiting <limiting option set on the server>
For example, if server is run with default options (without any command line options, python3 MIGP_server.py
), it initiates the leaked database with only one leak entry Alice,123456
). Now, you can use the client-side terminal in the following way and should get the following results:
python3 MIGP_client.py --username Alice --password 123456 # will give exact password matching
python3 MIGP_client.py --username Alice --password 123456$ # will give similar password matching
python3 MIGP_client.py --username Alice --password deercrossing # or any other password, will give not present in the leak
Here we simply assume user Alice
password 123456
has been leaked and 123456$
is a similar password of 123456
vulnerable to credential tweaking attack (line 81 in MIGP_server.py)
https://github.com/cloudflare/migp-go
We are always looking for ways to improve our codes. For any bugs please email at: mislam9@wisc.edu
If you use any part of our code or paper please cite our paper.
@inproceedings{pal2021might,
title={{Might I Get Pwned: A Second Generation Password Breach Alerting Service}},
author={Pal, Bijeeta and Islam, Mazharul and Bohuk, Marina Sanusi and Valenta, Luke and Wood, Chris and Whalen, Tara and Sullivan, Nick and Ristenpart, Thomas and Chatterjee, Rahul},
booktitle={31th {USENIX} Security Symposium ({USENIX} Security 22)},
year={2022},
organization={USENIX}
}