kpass-gen 0.2.0__py3-none-any.whl → 0.2.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kpass/__init__.py +6 -6
- kpass/main.py +120 -102
- kpass_gen-0.2.5.dist-info/METADATA +191 -0
- kpass_gen-0.2.5.dist-info/RECORD +7 -0
- kpass_gen-0.2.0.dist-info/METADATA +0 -175
- kpass_gen-0.2.0.dist-info/RECORD +0 -7
- {kpass_gen-0.2.0.dist-info → kpass_gen-0.2.5.dist-info}/WHEEL +0 -0
- {kpass_gen-0.2.0.dist-info → kpass_gen-0.2.5.dist-info}/licenses/LICENSE.txt +0 -0
- {kpass_gen-0.2.0.dist-info → kpass_gen-0.2.5.dist-info}/top_level.txt +0 -0
kpass/__init__.py
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
from .main import (
|
2
2
|
generator,
|
3
|
-
|
4
|
-
|
3
|
+
save_to_file,
|
4
|
+
apply_ciphers,
|
5
5
|
check_sequences,
|
6
6
|
veredict,
|
7
7
|
verify,
|
8
8
|
)
|
9
9
|
|
10
|
-
__version__ = "0.2.
|
10
|
+
__version__ = "0.2.5"
|
11
11
|
|
12
12
|
__all__ = [
|
13
13
|
"generator",
|
14
|
-
"
|
15
|
-
"
|
14
|
+
"save_to_file",
|
15
|
+
"apply_ciphers",
|
16
16
|
"check_sequences",
|
17
17
|
"veredict",
|
18
18
|
"verify",
|
19
|
-
]
|
19
|
+
]
|
kpass/main.py
CHANGED
@@ -2,6 +2,10 @@ import itertools
|
|
2
2
|
from rich.progress import Progress, BarColumn, TextColumn, TimeElapsedColumn
|
3
3
|
import re
|
4
4
|
import string
|
5
|
+
import json
|
6
|
+
from math import perm
|
7
|
+
from datetime import datetime
|
8
|
+
from pathlib import Path
|
5
9
|
|
6
10
|
# -----------------------------------------------------------------------------
|
7
11
|
# Ciphers dictionary to replace letters with leetspeak equivalents
|
@@ -38,7 +42,7 @@ ciphers = {
|
|
38
42
|
}
|
39
43
|
|
40
44
|
# -----------------------------------------------------------------------------
|
41
|
-
# Function:
|
45
|
+
# Function: apply_ciphers
|
42
46
|
# Description:
|
43
47
|
# Transforms input text by replacing each character according to the ciphers dict
|
44
48
|
# Parameters:
|
@@ -47,77 +51,139 @@ ciphers = {
|
|
47
51
|
# str: The transformed text with cipher substitutions
|
48
52
|
# -----------------------------------------------------------------------------
|
49
53
|
|
50
|
-
def
|
54
|
+
def apply_ciphers(text: str) -> str:
|
51
55
|
return ''.join(ciphers.get(char, char) for char in text)
|
52
56
|
|
53
57
|
# -----------------------------------------------------------------------------
|
54
|
-
#
|
58
|
+
# Utility: write with progress bar
|
59
|
+
# -----------------------------------------------------------------------------
|
60
|
+
|
61
|
+
def _write_with_progress(write_fn, items):
|
62
|
+
with Progress(
|
63
|
+
TextColumn("[progress.description]{task.description}"),
|
64
|
+
BarColumn(),
|
65
|
+
TimeElapsedColumn(),
|
66
|
+
) as progress:
|
67
|
+
task = progress.add_task("[cyan]Saving passwords...", total=len(items))
|
68
|
+
for item in items:
|
69
|
+
write_fn(item)
|
70
|
+
progress.update(task, advance=1)
|
71
|
+
|
72
|
+
# -----------------------------------------------------------------------------
|
73
|
+
# Function: save_to_file
|
55
74
|
# Description:
|
56
|
-
# Writes a list of passwords to a
|
75
|
+
# Writes a list of passwords, scores, and verdicts to a file with progress
|
57
76
|
# Parameters:
|
58
|
-
# passwords (list[str]): List of password strings
|
59
|
-
#
|
77
|
+
# passwords (list[str]): List of password strings
|
78
|
+
# scores (list[int]): Corresponding strength scores
|
79
|
+
# verdicts (list[str]): Corresponding verdict strings
|
80
|
+
# file_name (str): Output filename without extension
|
81
|
+
# file_type (str): Extension (json, csv, yaml, yml)
|
60
82
|
# Returns:
|
61
83
|
# None
|
62
84
|
# -----------------------------------------------------------------------------
|
63
85
|
|
64
|
-
def
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
86
|
+
def save_to_file(
|
87
|
+
passwords: list[str],
|
88
|
+
scores: list[int],
|
89
|
+
verdicts: list[str],
|
90
|
+
file_name: str = "pass_generated",
|
91
|
+
file_type: str = "json"
|
92
|
+
) -> None:
|
93
|
+
extension = file_type.lstrip('.')
|
94
|
+
path = Path(f"{file_name}.{extension}")
|
95
|
+
path.write_text("", encoding="utf-8-sig") # limpa conteúdo existente
|
96
|
+
|
97
|
+
def writer_json(item):
|
98
|
+
pwd, score, verdict = item
|
99
|
+
return json.dumps({"password": pwd, "score": score, "veredict": verdict}, indent=4, ensure_ascii=False) + "\n"
|
100
|
+
|
101
|
+
def writer_csv(item):
|
102
|
+
pwd, score, verdict = item
|
103
|
+
return (
|
104
|
+
f'"password","{pwd}",\n'
|
105
|
+
f'"score","{score}",\n'
|
106
|
+
f'"veredict","{verdict}"\n\\n'
|
107
|
+
)
|
108
|
+
|
109
|
+
def writer_yaml(item):
|
110
|
+
pwd, score, verdict = item
|
111
|
+
return (
|
112
|
+
f'"password": "{pwd}"\n'
|
113
|
+
f'"score": "{score}"\n'
|
114
|
+
f'"veredict": "{verdict}"\n\\n'
|
115
|
+
)
|
116
|
+
|
117
|
+
if extension == "json":
|
118
|
+
writer = writer_json
|
119
|
+
elif extension == "csv":
|
120
|
+
writer = writer_csv
|
121
|
+
elif extension in ("yaml", "yml"):
|
122
|
+
writer = writer_yaml
|
123
|
+
else:
|
124
|
+
raise ValueError(f"Unsupported file type: {file_type}")
|
125
|
+
|
126
|
+
items = list(zip(passwords, scores, verdicts))
|
127
|
+
with Progress(
|
128
|
+
TextColumn("[progress.description]{task.description}"),
|
129
|
+
BarColumn(),
|
130
|
+
TimeElapsedColumn(),
|
131
|
+
) as progress:
|
132
|
+
task = progress.add_task("[cyan]Saving passwords...", total=len(items))
|
133
|
+
with path.open("a", encoding="utf-8-sig") as file:
|
134
|
+
for item in items:
|
135
|
+
file.write(writer(item))
|
136
|
+
progress.update(task, advance=1)
|
137
|
+
|
138
|
+
# -----------------------------------------------------------------------------
|
139
|
+
# Function: base_files_architecture (no changes needed)
|
140
|
+
# -----------------------------------------------------------------------------
|
141
|
+
def base_files_architecture(password, score, verdict, file_type):
|
142
|
+
if file_type.lower() in ("json", ".json"):
|
143
|
+
return json.dumps({"password": password, "score": str(score), "veredict": verdict}, indent=4, ensure_ascii=False) + "\n\n"
|
144
|
+
if file_type.lower() in ("csv", ".csv"):
|
145
|
+
return (
|
146
|
+
f'"password","{password}",\n'
|
147
|
+
f'"score","{score}\n"'
|
148
|
+
f'"veredict","{verdict}"\n'
|
149
|
+
) + "\n"
|
150
|
+
if file_type.lower() in ("yaml", ".yaml", "yml", ".yml"):
|
151
|
+
return (
|
152
|
+
f'"password": "{password}"\n'
|
153
|
+
f'"score": "{score}"\n'
|
154
|
+
f'"veredict": "{verdict}"\n'
|
155
|
+
) + "\n"
|
75
156
|
|
76
157
|
# -----------------------------------------------------------------------------
|
77
158
|
# Function: generator
|
78
159
|
# Description:
|
79
160
|
# Builds possible password permutations based on user info and ciphers,
|
80
|
-
# filters by length, and saves them
|
81
|
-
# Parameters:
|
82
|
-
# name (str): Full name input for generating bases
|
83
|
-
# age (str): Age string (e.g., '25')
|
84
|
-
# birth_date (str): Birth date in 'DD/MM/YYYY' format
|
85
|
-
# Returns:
|
86
|
-
# None (calls save_to_txt internally)
|
161
|
+
# filters by length, evaluates strength, and saves them
|
87
162
|
# -----------------------------------------------------------------------------
|
88
163
|
|
89
|
-
def generator(
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
164
|
+
def generator(
|
165
|
+
name: str,
|
166
|
+
age: str,
|
167
|
+
birth_date: str,
|
168
|
+
file_type: str = "json",
|
169
|
+
file_name: str = "pass_generated"
|
170
|
+
) -> None:
|
171
|
+
dt = datetime.strptime(birth_date, "%d/%m/%Y")
|
172
|
+
day, month, year = dt.strftime("%d"), dt.strftime("m"), dt.strftime("Y")
|
94
173
|
name_tiny = name.lower().replace(" ", "")
|
95
|
-
name_capital = name.upper().replace(" ", "")
|
96
|
-
|
97
174
|
parts = name.split()
|
98
175
|
first = parts[0]
|
99
176
|
middle = "".join(parts[1:-1]) if len(parts) > 2 else ""
|
100
177
|
last = parts[-1] if len(parts) > 1 else ""
|
101
|
-
|
102
|
-
# Reverse age string for variation
|
103
178
|
age_reversed = age[::-1]
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
name_tiny,
|
108
|
-
day, month, year,
|
109
|
-
age, age_reversed,
|
110
|
-
aplly_ciphers(name_tiny), aplly_ciphers(first), aplly_ciphers(last)
|
179
|
+
bases = [
|
180
|
+
name_tiny, name.upper().replace(" ", ""), first, middle, last,
|
181
|
+
day, month, year, age, age_reversed,
|
182
|
+
apply_ciphers(name_tiny), apply_ciphers(first), apply_ciphers(last)
|
111
183
|
]
|
112
|
-
|
113
|
-
# Remove duplicates and empty strings
|
114
|
-
base_combinations = list({item for item in base_combinations if item.strip()})
|
115
|
-
|
184
|
+
bases = list({b for b in bases if b.strip()})
|
116
185
|
possible_passwords = set()
|
117
|
-
|
118
|
-
# Calculate total permutations for progress bar
|
119
|
-
total = sum(len(list(itertools.permutations(base_combinations, i))) for i in range(2, 5))
|
120
|
-
|
186
|
+
total = sum(perm(len(bases), r) for r in range(2, 5))
|
121
187
|
with Progress(
|
122
188
|
TextColumn("[cyan]Generating passwords..."),
|
123
189
|
BarColumn(),
|
@@ -125,23 +191,17 @@ def generator(name: str, age: str, birth_date: str) -> None:
|
|
125
191
|
) as progress:
|
126
192
|
task = progress.add_task("passwords", total=total)
|
127
193
|
for length in range(2, 5):
|
128
|
-
for combo in itertools.permutations(
|
194
|
+
for combo in itertools.permutations(bases, length):
|
129
195
|
pwd = "".join(combo)
|
130
196
|
if 6 <= len(pwd) <= 18:
|
131
197
|
possible_passwords.add(pwd)
|
132
198
|
progress.update(task, advance=1)
|
133
|
-
|
134
|
-
|
135
|
-
|
199
|
+
scored = [(pwd, verify(pwd, False), veredict(verify(pwd, False))) for pwd in possible_passwords]
|
200
|
+
passwords, scores, verdicts = zip(*scored)
|
201
|
+
save_to_file(list(passwords), list(scores), list(verdicts), file_name, file_type)
|
136
202
|
|
137
203
|
# -----------------------------------------------------------------------------
|
138
|
-
#
|
139
|
-
# Description:
|
140
|
-
# Detects ascending or descending numeric sequences of length 3 in password
|
141
|
-
# Parameters:
|
142
|
-
# password (str): The password string to check
|
143
|
-
# Returns:
|
144
|
-
# bool: True if a sequence is found, False otherwise
|
204
|
+
# Sequence, verdict, and verify unchanged (except typo fix)
|
145
205
|
# -----------------------------------------------------------------------------
|
146
206
|
|
147
207
|
def check_sequences(password: str) -> bool:
|
@@ -153,69 +213,27 @@ def check_sequences(password: str) -> bool:
|
|
153
213
|
return True
|
154
214
|
return False
|
155
215
|
|
156
|
-
# -----------------------------------------------------------------------------
|
157
|
-
# Function: veredict
|
158
|
-
# Description:
|
159
|
-
# Maps numeric strength score to a hashtag-based verdict string
|
160
|
-
# Parameters:
|
161
|
-
# score (int): Numeric strength score (0-6)\# Returns:
|
162
|
-
# str: Verdict hashtag
|
163
|
-
# -----------------------------------------------------------------------------
|
164
|
-
|
165
216
|
def veredict(score: int) -> str:
|
166
217
|
levels = [
|
167
|
-
"#very_weak",
|
168
|
-
"#weak", # 1
|
169
|
-
"#weak", # 2
|
170
|
-
"#mean", # 3
|
171
|
-
"#good", # 4
|
172
|
-
"#strong", # 5
|
173
|
-
"#very_strong" # 6
|
218
|
+
"#very_weak", "#weak", "#weak", "#mean", "#good", "#strong", "#very_strong"
|
174
219
|
]
|
175
|
-
# Safeguard for out-of-range scores
|
176
220
|
return levels[score] if 0 <= score < len(levels) else "#unknown"
|
177
221
|
|
178
|
-
# -----------------------------------------------------------------------------
|
179
|
-
# Function: verify
|
180
|
-
# Description:
|
181
|
-
# Evaluates password strength by checking length, digits, punctuation,
|
182
|
-
# case variety, and absence of predictable sequences
|
183
|
-
# Parameters:
|
184
|
-
# password (str): Password string to evaluate
|
185
|
-
# want_verdict (bool): If True, return textual verdict; else, return numeric score
|
186
|
-
# Returns:
|
187
|
-
# int | str: Numerical strength score or verdict string for you to treat the values as you wish, the values (int) range from 0 - 6
|
188
|
-
# -----------------------------------------------------------------------------
|
189
|
-
|
190
222
|
def verify(
|
191
223
|
password: str,
|
192
224
|
want_verdict: bool = True,
|
193
225
|
) -> int | str:
|
194
226
|
strength = 0
|
195
|
-
|
196
|
-
# Length check (>=8 chars)
|
197
227
|
if len(password) >= 8:
|
198
228
|
strength += 1
|
199
|
-
|
200
|
-
# Digit presence
|
201
229
|
if re.search(r'\d', password):
|
202
230
|
strength += 1
|
203
|
-
|
204
|
-
# Special character presence
|
205
231
|
if any(c in string.punctuation for c in password):
|
206
232
|
strength += 1
|
207
|
-
|
208
|
-
# Uppercase letter presence
|
209
233
|
if any(c.isupper() for c in password):
|
210
234
|
strength += 1
|
211
|
-
|
212
|
-
# Lowercase letter presence
|
213
235
|
if any(c.islower() for c in password):
|
214
236
|
strength += 1
|
215
|
-
|
216
|
-
# Sequence check (deduct if predictable)
|
217
237
|
if not check_sequences(password):
|
218
238
|
strength += 1
|
219
|
-
|
220
|
-
# Return verdict or raw score
|
221
239
|
return veredict(strength) if want_verdict else strength
|
@@ -0,0 +1,191 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: kpass-gen
|
3
|
+
Version: 0.2.5
|
4
|
+
Summary: kpass is a Python toolkit for generating, ciphering and evaluating passwords with JSON, CSV and YAML export.
|
5
|
+
Author-email: "Lucas Paulino Da Silva (~K')" <lucas.workps@gmail.com>
|
6
|
+
License: MIT License
|
7
|
+
|
8
|
+
Copyright (c) [year] [fullname]
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
18
|
+
copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
+
SOFTWARE.
|
27
|
+
Project-URL: homepage, https://github.com/lucaspy-stack/kpass
|
28
|
+
Project-URL: repository, https://github.com/lucaspy-stack/kpass
|
29
|
+
Keywords: password,generator,leet,name-based,cybersecurity,pentest,automation,security,rich,csv,yaml,json,python
|
30
|
+
Classifier: Development Status :: 4 - Beta
|
31
|
+
Classifier: Intended Audience :: Developers
|
32
|
+
Classifier: Topic :: Security :: Cryptography
|
33
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
35
|
+
Classifier: Operating System :: OS Independent
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
37
|
+
Classifier: Programming Language :: Python :: 3.6
|
38
|
+
Classifier: Programming Language :: Python :: 3.7
|
39
|
+
Classifier: Programming Language :: Python :: 3.8
|
40
|
+
Classifier: Programming Language :: Python :: 3.9
|
41
|
+
Classifier: Programming Language :: Python :: 3.10
|
42
|
+
Classifier: Programming Language :: Python :: 3.11
|
43
|
+
Classifier: Programming Language :: Python :: 3.12
|
44
|
+
Requires-Python: >=3.6
|
45
|
+
Description-Content-Type: text/markdown
|
46
|
+
License-File: LICENSE.txt
|
47
|
+
Requires-Dist: rich
|
48
|
+
Dynamic: license-file
|
49
|
+
|
50
|
+
# 🔐 kpass — Smart Password Generator & Evaluator
|
51
|
+
|
52
|
+
<p align="center">
|
53
|
+
<img src="assets/kpass_icon.png" alt="kpass logo" width="100%"/>
|
54
|
+
</p>
|
55
|
+
|
56
|
+
**kpass** is a Python toolkit for **generating**, **ciphering** and **evaluating** passwords—designed for **educational**, **testing** and **automation** scenarios.
|
57
|
+
|
58
|
+
---
|
59
|
+
|
60
|
+
## ✨ Features
|
61
|
+
|
62
|
+
* **Generate** hundreds or thousands of password combinations from:
|
63
|
+
|
64
|
+
* Full name
|
65
|
+
* Age
|
66
|
+
* Birth date
|
67
|
+
* **Leet‑speak** substitutions like `A → 4`, `E → 3`, `S → $`
|
68
|
+
* **Strength evaluation** based on:
|
69
|
+
|
70
|
+
* Length
|
71
|
+
* Digits
|
72
|
+
* Special characters
|
73
|
+
* Mixed case
|
74
|
+
* Numeric sequence patterns
|
75
|
+
* **Export** automatically to `.json`, `.csv` or `.yaml` with a progress bar powered by **rich**
|
76
|
+
|
77
|
+
---
|
78
|
+
|
79
|
+
## ⚠️ Security Disclaimer
|
80
|
+
|
81
|
+
This project **does not** produce secure passwords for production systems.
|
82
|
+
It uses **predictable** inputs (names, dates) and should **not** be used for real authentication.
|
83
|
+
|
84
|
+
---
|
85
|
+
|
86
|
+
## 🎯 Use Cases
|
87
|
+
|
88
|
+
* 🧠 **Cybersecurity Awareness**
|
89
|
+
Learn why personal info makes weak passwords.
|
90
|
+
|
91
|
+
* 🧰 **Pentesting & Wordlist Creation**
|
92
|
+
Build custom dictionaries for ethical hacking.
|
93
|
+
|
94
|
+
* 🧪 **Automation & Testing**
|
95
|
+
Generate dummy passwords for scripts, bots or sandbox environments.
|
96
|
+
|
97
|
+
---
|
98
|
+
|
99
|
+
## 📦 Installation
|
100
|
+
|
101
|
+
```bash
|
102
|
+
pip install kpass-gen
|
103
|
+
```
|
104
|
+
|
105
|
+
> Requires Python 3.6+
|
106
|
+
|
107
|
+
---
|
108
|
+
|
109
|
+
## 🚀 Quick Start
|
110
|
+
|
111
|
+
### 1. Generate Passwords
|
112
|
+
|
113
|
+
```python
|
114
|
+
from kpass import generator
|
115
|
+
|
116
|
+
# Example: Johnny Silverhand (born 08/07/2000, age 50 in 2077)
|
117
|
+
generator(
|
118
|
+
name="Johnny Silverhand",
|
119
|
+
age="50",
|
120
|
+
birth_date="08/07/2000",
|
121
|
+
file_type="json", # optional: json, csv, yaml or yml
|
122
|
+
file_name="jsilverhand" # optional: filename without extension
|
123
|
+
)
|
124
|
+
```
|
125
|
+
|
126
|
+
### 2. Apply Leet Cipher
|
127
|
+
|
128
|
+
```python
|
129
|
+
from kpass import apply_ciphers
|
130
|
+
|
131
|
+
# Example: Panam Palmer
|
132
|
+
leet = apply_ciphers("Panam Palmer")
|
133
|
+
print(leet) # → "|D4|\\|4/\\/\\ |D41/\\/\\312"
|
134
|
+
```
|
135
|
+
|
136
|
+
### 3. Save Custom Password Lists
|
137
|
+
|
138
|
+
```python
|
139
|
+
from kpass import save_to_file
|
140
|
+
|
141
|
+
# Example passwords inspired by Cyberpunk characters
|
142
|
+
passwords = ["Chipp4020!", "AltAccount2077$", "RoughTrade37#"]
|
143
|
+
scores = [3, 5, 4]
|
144
|
+
verdicts = ["#mean", "#strong", "#good"]
|
145
|
+
|
146
|
+
save_to_file(
|
147
|
+
passwords,
|
148
|
+
scores,
|
149
|
+
verdicts,
|
150
|
+
file_name="cyberpunk_list",
|
151
|
+
file_type="csv" # outputs cyberpunk_list.csv
|
152
|
+
)
|
153
|
+
```
|
154
|
+
|
155
|
+
### 4. Check Password Strength
|
156
|
+
|
157
|
+
```python
|
158
|
+
from kpass import verify
|
159
|
+
|
160
|
+
# returns "#very_strong"
|
161
|
+
print(verify("R0gueDr1ft!99"))
|
162
|
+
|
163
|
+
# returns 6
|
164
|
+
print(verify("R0gueDr1ft!99", want_verdict=False))
|
165
|
+
```
|
166
|
+
|
167
|
+
---
|
168
|
+
|
169
|
+
## 🔧 API Reference
|
170
|
+
|
171
|
+
| Function | Description |
|
172
|
+
| ----------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
173
|
+
| `generator(name, age, birth_date, file_type, file_name)` | Generates permutations, evaluates strength, and saves to a file |
|
174
|
+
| `apply_ciphers(text)` | Applies leet‑speak substitutions |
|
175
|
+
| `save_to_file(passwords, scores, verdicts, file_name, file_type)` | Exports password list + scores + verdicts with a progress bar |
|
176
|
+
| `verify(password, want_verdict=True)` | Evaluates strength; returns an `int` score or `str` verdict (`#good`, etc.) |
|
177
|
+
| `check_sequences(password)` | Detects ascending/descending numeric sequences |
|
178
|
+
| `veredict(score)` | Maps numeric score to verdict string (`#weak`, `#strong`, etc.) |
|
179
|
+
|
180
|
+
---
|
181
|
+
|
182
|
+
## ✅ Requirements
|
183
|
+
|
184
|
+
* Python 3.6 or higher
|
185
|
+
* [rich](https://pypi.org/project/rich/) for progress bars
|
186
|
+
|
187
|
+
---
|
188
|
+
|
189
|
+
## 📄 License
|
190
|
+
|
191
|
+
MIT License — free to use, modify and share.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
kpass/__init__.py,sha256=EC7FCcioji9m_sHw2aQbb7azvFdEbaukRhKv6P2sAbc,287
|
2
|
+
kpass/main.py,sha256=mrabkAqt15OCakMiCgsH35NoT5AAwvAQGu4I2lh34wk,9027
|
3
|
+
kpass_gen-0.2.5.dist-info/licenses/LICENSE.txt,sha256=Qv2ilebwoUtMJnRsZwRy729xS5JZQzLauJ0tQzkAkTA,1088
|
4
|
+
kpass_gen-0.2.5.dist-info/METADATA,sha256=AAd4pOSmeUNpN3r7QpIthlGGdHT7RBNOwa0ln0mb8MI,6640
|
5
|
+
kpass_gen-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
+
kpass_gen-0.2.5.dist-info/top_level.txt,sha256=l8YfdoHutpiGNi7Zw-_bkGH48JGtmWU2Ac6nwvSb3dU,6
|
7
|
+
kpass_gen-0.2.5.dist-info/RECORD,,
|
@@ -1,175 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: kpass-gen
|
3
|
-
Version: 0.2.0
|
4
|
-
Summary: kpass is a simple password generator based on full name, age, and birthdate.
|
5
|
-
Author-email: "Lucas Paulino Da Silva (KsxDynamic)" <lucas.workps@gmail.com>
|
6
|
-
License: MIT License
|
7
|
-
|
8
|
-
Copyright (c) [year] [fullname]
|
9
|
-
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
12
|
-
in the Software without restriction, including without limitation the rights
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
15
|
-
furnished to do so, subject to the following conditions:
|
16
|
-
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
18
|
-
copies or substantial portions of the Software.
|
19
|
-
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
-
SOFTWARE.
|
27
|
-
Project-URL: Homepage, https://github.com/lucaspy-stack/kpass
|
28
|
-
Project-URL: Repository, https://github.com/lucaspy-stack/kpass
|
29
|
-
Classifier: Programming Language :: Python :: 3
|
30
|
-
Classifier: License :: OSI Approved :: MIT License
|
31
|
-
Classifier: Operating System :: OS Independent
|
32
|
-
Requires-Python: >=3.6
|
33
|
-
Description-Content-Type: text/markdown
|
34
|
-
License-File: LICENSE.txt
|
35
|
-
Requires-Dist: rich
|
36
|
-
Dynamic: license-file
|
37
|
-
|
38
|
-
# kpass
|
39
|
-
|
40
|
-
**kpass** is a Python library that:
|
41
|
-
|
42
|
-
1. Generates hundreds (or thousands) of password combinations based on a person’s full name, age, and date of birth.
|
43
|
-
2. Applies “leet”-style substitutions (e.g., A → 4, S → $, E → 3).
|
44
|
-
3. Calculates **password strength** according to length, digit presence, special characters, mixed case, and absence of simple numeric sequences.
|
45
|
-
4. Automatically saves generated passwords to a `.txt` file with progress bars powered by the `rich` library.
|
46
|
-
|
47
|
-
---
|
48
|
-
|
49
|
-
## 📦 Installation
|
50
|
-
|
51
|
-
```bash
|
52
|
-
pip install kpass-gen
|
53
|
-
````
|
54
|
-
|
55
|
-
---
|
56
|
-
|
57
|
-
## 🚀 Example Usage
|
58
|
-
|
59
|
-
### 1. Generating Passwords
|
60
|
-
|
61
|
-
```python
|
62
|
-
from kpass import generator
|
63
|
-
|
64
|
-
# Generate hundreds of password combinations based on personal data
|
65
|
-
generator(
|
66
|
-
name="Johnny Silverhand",
|
67
|
-
age="34",
|
68
|
-
birth_date="16/11/1988"
|
69
|
-
)
|
70
|
-
```
|
71
|
-
|
72
|
-
> This will create a file named `pass_generated.txt` (in the default or specified folder) containing all valid passwords between 6 and 18 characters, with a progress bar shown during generation.
|
73
|
-
|
74
|
-
---
|
75
|
-
|
76
|
-
### 2. Applying Leet-Style Substitutions
|
77
|
-
|
78
|
-
```python
|
79
|
-
from kpass import aplly_ciphers
|
80
|
-
|
81
|
-
original = "SecurePass"
|
82
|
-
leet = aplly_ciphers(original)
|
83
|
-
print(leet) # → "$3cur3P4$$" (example)
|
84
|
-
```
|
85
|
-
|
86
|
-
---
|
87
|
-
|
88
|
-
### 3. Saving Passwords Manually
|
89
|
-
|
90
|
-
If you already have a list of passwords and only want to save them:
|
91
|
-
|
92
|
-
```python
|
93
|
-
from kpass import save_to_txt
|
94
|
-
|
95
|
-
passwords = ["abc123!", "Johnny34@", "4bcc!23"]
|
96
|
-
save_to_txt(passwords, file_name="my_passwords.txt")
|
97
|
-
```
|
98
|
-
|
99
|
-
---
|
100
|
-
|
101
|
-
### 4. Checking Password Strength
|
102
|
-
|
103
|
-
```python
|
104
|
-
from kpass import verify
|
105
|
-
|
106
|
-
# Returns a numeric score (0–6)
|
107
|
-
score = verify(password="Luc@s683", want_verdict=False)
|
108
|
-
print(score) # → 6
|
109
|
-
|
110
|
-
# Returns a hashtag verdict
|
111
|
-
label = verify(password="Luc@s683", want_verdict=True)
|
112
|
-
print(label) # → "#very_strong"
|
113
|
-
```
|
114
|
-
|
115
|
-
| Score | Verdict | Description |
|
116
|
-
| :---: | :------------ | :---------- |
|
117
|
-
| 0 | #very\_weak | Very weak |
|
118
|
-
| 1–2 | #weak | Weak |
|
119
|
-
| 3 | #mean | Average |
|
120
|
-
| 4 | #good | Good |
|
121
|
-
| 5 | #strong | Strong |
|
122
|
-
| 6 | #very\_strong | Very strong |
|
123
|
-
|
124
|
-
---
|
125
|
-
|
126
|
-
## 🔧 API Reference
|
127
|
-
|
128
|
-
```python
|
129
|
-
generator(
|
130
|
-
name: str,
|
131
|
-
age: str,
|
132
|
-
birth_date: str
|
133
|
-
) -> None
|
134
|
-
```
|
135
|
-
|
136
|
-
* **Generates** and **saves** password combinations automatically to `pass_generated.txt`.
|
137
|
-
|
138
|
-
```python
|
139
|
-
aplly_ciphers(
|
140
|
-
text: str
|
141
|
-
) -> str
|
142
|
-
```
|
143
|
-
|
144
|
-
* **Transforms** the input text using leet-style substitutions defined in the internal dictionary.
|
145
|
-
|
146
|
-
```python
|
147
|
-
save_to_txt(
|
148
|
-
passwords: list[str],
|
149
|
-
file_name: str = "pass_generated.txt"
|
150
|
-
) -> None
|
151
|
-
```
|
152
|
-
|
153
|
-
* **Saves** the list of passwords to a text file, displaying a progress bar in the terminal.
|
154
|
-
|
155
|
-
```python
|
156
|
-
verify(
|
157
|
-
password: str,
|
158
|
-
want_verdict: bool = True
|
159
|
-
) -> int | str
|
160
|
-
```
|
161
|
-
|
162
|
-
* **Evaluates** the strength of a password: returns a numeric score (0–6) or, if `want_verdict=True`, the corresponding hashtag verdict.
|
163
|
-
|
164
|
-
---
|
165
|
-
|
166
|
-
## ✅ Requirements
|
167
|
-
|
168
|
-
* Python 3.6 or higher
|
169
|
-
* `rich`
|
170
|
-
|
171
|
-
---
|
172
|
-
|
173
|
-
## 📄 License
|
174
|
-
|
175
|
-
This project is licensed under the MIT License.
|
kpass_gen-0.2.0.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
kpass/__init__.py,sha256=bUr2UtraVAjFR9W9po0s0pRyNKoPFOG8rnrjPda9Gso,287
|
2
|
-
kpass/main.py,sha256=Rc10h0zP4GXHIf6yJbOnD6n-RgnrJHlEUV1ZLo_BVnc,8112
|
3
|
-
kpass_gen-0.2.0.dist-info/licenses/LICENSE.txt,sha256=Qv2ilebwoUtMJnRsZwRy729xS5JZQzLauJ0tQzkAkTA,1088
|
4
|
-
kpass_gen-0.2.0.dist-info/METADATA,sha256=438Fn1LAAha1AKCvJP23c064ce91lgsxjRkkZ6PcB6w,5059
|
5
|
-
kpass_gen-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
kpass_gen-0.2.0.dist-info/top_level.txt,sha256=l8YfdoHutpiGNi7Zw-_bkGH48JGtmWU2Ac6nwvSb3dU,6
|
7
|
-
kpass_gen-0.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|