Skip to main content
# Passwords
I have been working with password leaks for a while, and dealing with them is
not always fun due to multiple reasons. They are often large, takes a lot of time
to load in memory, and have mix of strings in different format, such as `UTF-8`,
`UTF-16`, `ASCII`. These make the files very annoying to process. The result is a
mess of error handling and memory management, instead of quickly compute the
statistics we want to compute.

I have to do it for living (at least for now), and so I decided to create this
little module to efficiently store and process the password leak files. This
library expects a clean password file, and it will not clean it for you. It
just makes life easy afterwards to process this file for other purposes. Not
sure how generic is the purpose, as I am the only one who is using it right now.
All feedbacks are very welcome.

Cleaned password-leak files can be downloaded from https://wiki.skullsecurity.org/Passwords.

## How to install?
Dependencies:
* `numpy`
* `marisa_trie`

Download the `readpw.py` file into your main code and it should work. Or, install via pip,
`pip install readpw`



## How to use?
```ipython
In [1]: from readpw import Passwords

In [2]: ry = Passwords('/home/rahul/passwords/rockyou-withcount.txt.bz2')

In [3]: for id_, pw, f in ry.iterpws(10):
...: print id_, pw, f
...:
3121838 123456 290729.0
919221 12345 79076.0
12769146 123456789 76789.0
11327966 password 59462.0
11789229 iloveyou 49952.0
11389450 princess 33291.0
6851250 1234567 21725.0
8034161 rockyou 20901.0
10680580 12345678 20553.0
2902439 abc123 16648.0

In [5]: ry.sumvalues(10) # sums the frequency of most frequent 10 passwords.
Out[5]: 669126.0

In [6]: list(ry.sample_pws(10))
Out[6]:
[u'lilmarvin09',
u'evan*love',
u'mylove',
u'mmmsss',
u'whudafxup?',
u'123456',
u'123456',
u'beautiful',
u'james123',
u'foodie123']


```

Release files for readpw 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for readpw 1.0.0
File Interpreter ABI Platform
readpw-1.0.0-py3.6.egg Legacy Egg format - - Details
readpw-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / readpw-1.0.0-py3.6.egg

Download URL readpw-1.0.0-py3.6.egg
Size 6.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
75c9101c81959483f0cd5791211175ac758928a63fceb07ceda22f4604bdc852
BLAKE2b-256 checksum
How to use checksums
f9f30c3e75d7babf085966378e8226b7b29714193031ffd4089fd57113c416ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / readpw-1.0.0-py3-none-any.whl

Download URL readpw-1.0.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b93599f57d04ac5f7ba1e0f45a981d6c41787c3d82c1a989f1fba71295564625
BLAKE2b-256 checksum
How to use checksums
a7c39fc178f8dcfdfa2ff9a7d95bca35b405a98f401d15d0b935232a967d1a75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page