Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linsomniac/python-ctypescracklib
Python ctypes wrapper for cracklib.
https://github.com/linsomniac/python-ctypescracklib
Last synced: 11 days ago
JSON representation
Python ctypes wrapper for cracklib.
- Host: GitHub
- URL: https://github.com/linsomniac/python-ctypescracklib
- Owner: linsomniac
- Created: 2010-11-16T03:49:27.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-17T23:11:11.000Z (about 14 years ago)
- Last Synced: 2023-07-26T17:13:04.918Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
python-ctypescracklib
Written by Sean Reifschneider
Placed in the public domain.
No rights reserved.Cracklib is great, and in newer packages there is a Python module available
for it. However, on systems that don't yet have it, such as CentOS 5, I've
written a ctypes wrapper for the system cryptlib. This would also work on a
system that you can't install python-libcrypt. It does require python with
ctypes available, so for CentOS 5 you have to install and use the python26
package.It also has the advantage that it can take the username and check for
passwords that contain it or are substantially similar, like the libcrypt
"FascistGecos" function but without requiring the user to exist in
/etc/passwd.Some example uses:
>>> FascistCheck('jafo1234', 'jafo')
'it is based on your username'
>>> FascistCheck('myofaj123', 'jafo')
'it is based on your username'
>>> FascistCheck('jxayfoxo', 'jafo')
'it is too similar to your username'
>>> FascistCheck('cretse')
'it is based on a dictionary word'