kpass-gen 0.1.1__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 ADDED
@@ -0,0 +1,3 @@
1
+ from .generator import pass_generator, save_to_txt, aplly_ciphers
2
+
3
+ __version__ = "0.1.1"
kpass/generator.py ADDED
@@ -0,0 +1,106 @@
1
+ # Password generator itself
2
+
3
+ import itertools
4
+ from rich.progress import Progress, BarColumn, TextColumn, TimeElapsedColumn
5
+ import os
6
+
7
+ # Ciphers dictionary to replace letters
8
+ ciphers = {
9
+ "A": "4", "a": "4", "Á": "4", "á": "4", "@": "4",
10
+ "B": "8", "b": "8",
11
+ "C": "(", "c": "(",
12
+ "D": "[)", "d": "[)",
13
+ "E": "3", "e": "3", "É": "3", "é": "3", "&": "3",
14
+ "F": "#", "f": "#",
15
+ "G": "6", "g": "6",
16
+ "H": "#", "h": "#",
17
+ "I": "1", "i": "1", "Í": "1", "í": "1", "!": "1",
18
+ "J": "_|", "j": "_|",
19
+ "K": "|<", "k": "|<",
20
+ "L": "1", "l": "1",
21
+ "M": "/\\/\\", "m": "/\\/\\",
22
+ "N": "|\\|", "n": "|\\|",
23
+ "O": "0", "o": "0", "Ó": "0", "ó": "0",
24
+ "P": "|D", "p": "|D",
25
+ "Q": "0_", "q": "0_",
26
+ "R": "12", "r": "12",
27
+ "S": "$", "s": "$", "Š": "$", "š": "$",
28
+ "T": "7", "t": "7",
29
+ "U": "(_)", "u": "(_)",
30
+ "V": "\\/", "v": "\\/",
31
+ "W": "\\/\\/", "w": "\\/\\/",
32
+ "X": "%", "x": "%",
33
+ "Y": "`/", "y": "`/",
34
+ "Z": "2", "z": "2"
35
+ }
36
+
37
+
38
+ # Function to apply ciphers to text
39
+ def aplly_ciphers(text):
40
+ return ''.join(ciphers.get(char, char) for char in text)
41
+
42
+ # Function to generate passwords
43
+
44
+ def generator(name, age, birth_date):
45
+ day, month, yaer = birth_date.split("/")
46
+
47
+ name_tiny = name.lower().replace(" ", "")
48
+ name_capital = name.upper().replace(" ", "")
49
+
50
+ parts_name = name.split()
51
+ first = parts_name[0]
52
+ middle = "".join(parts_name[1:-1]) if len(parts_name) > 2 else ""
53
+ last = parts_name[-1] if len(parts_name) > 1 else ""
54
+
55
+ age_reversed = age[::-1]
56
+
57
+ base_combinations = [
58
+ name_tiny, name_capital, first, middle, last,
59
+ day, month, yaer,
60
+ age, age_reversed,
61
+ aplly_ciphers(name_tiny), aplly_ciphers(first), aplly_ciphers(last)
62
+ ]
63
+
64
+ base_combinations = list(set(filter(lambda x: x.strip() != "", base_combinations)))
65
+
66
+ possible_passwords = set()
67
+
68
+ # Calcula o total de combinações pra progress bar
69
+ total = sum(len(list(itertools.permutations(base_combinations, i))) for i in range(2, 5))
70
+
71
+ with Progress(
72
+ TextColumn("[cyan]Generating passwords..."),
73
+ BarColumn(),
74
+ TimeElapsedColumn(),
75
+ ) as progress:
76
+ task = progress.add_task("passwords", total=total)
77
+
78
+ for i in range(2, 5):
79
+ for combo in itertools.permutations(base_combinations, i):
80
+ password = "".join(combo)
81
+ if 6 <= len(password) <= 18:
82
+ possible_passwords.add(password)
83
+ progress.update(task, advance=1)
84
+
85
+ save_to_txt(list(possible_passwords))
86
+
87
+ return true
88
+
89
+ # Function to save passwords to file
90
+
91
+ def save_to_txt(passwords, file_name="pass_generated.txt"):
92
+ path = "passwords_generator"
93
+ os.makedirs(path, exist_ok=True)
94
+
95
+ with open(os.path.join(path, file_name), "w", encoding="utf-8-sig") as file:
96
+ with Progress(
97
+ TextColumn("[progress.description]{task.description}"),
98
+ BarColumn(),
99
+ TimeElapsedColumn(),
100
+ ) as progress:
101
+
102
+ tarefa = progress.add_task("[cyan]Saving passwords...", total=len(passwords))
103
+
104
+ for password in passwords:
105
+ file.write(password + "\n")
106
+ progress.update(tarefa, advance=1)
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: kpass-gen
3
+ Version: 0.1.1
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-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/lucaspy-stack/kpass
8
+ Project-URL: Repository, https://github.com/lucaspy-stack/kpass
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE.txt
14
+ Requires-Dist: rich
15
+ Dynamic: license-file
16
+
17
+ # kpass
18
+
19
+ **kpass** is a Python library that generates hundreds (or thousands) of password combinations based on a person's full name, age, and date of birth.
20
+
21
+ It also includes `leet`-style substitutions (e.g., A → 4, S → $, E → 3), and automatically saves the generated passwords to a `.txt` file with progress bars using the `rich` library.
22
+
23
+ ---
24
+
25
+ ## 📦 Installation
26
+
27
+ ```bash
28
+ pip install kpass
29
+ ```
30
+ ---
31
+
32
+ 🚀 Example usage
33
+
34
+
35
+ ```python
36
+ from kpass import generator
37
+
38
+ # Generate passwords based on personal data
39
+ generator(
40
+ name="Jhonny Silverhand",
41
+ age="34",
42
+ birth_date="16/11/1988"
43
+ )
44
+ ```
45
+
46
+ This will create a folder called passwords_generator containing a file named pass_generated.txt with valid password combinations between 6 and 18 characters.
47
+
48
+
49
+ ---
50
+
51
+ 🔧 Available functions
52
+
53
+ generator(name: str, age: str, birth_date: str) -> bool
54
+
55
+ Generates and saves passwords automatically.
56
+
57
+ aplly_ciphers(text: str) -> str
58
+
59
+ Applies leet-style substitutions to the given text (e.g., A → 4, S → $, etc.).
60
+
61
+ save_to_txt(passwords: list[str], file_name: str = "pass_generated.txt")
62
+
63
+ Saves a list of passwords to a .txt file with a progress bar.
64
+
65
+
66
+ ---
67
+
68
+ ✅ Requirements
69
+
70
+ Python 3.6 or higher
71
+
72
+ rich
73
+
74
+
75
+ ---
76
+
77
+ 📄 License
78
+
79
+ This project is licensed under the MIT License.
80
+
81
+
82
+
@@ -0,0 +1,7 @@
1
+ kpass/__init__.py,sha256=eFRRaHc8aQuidEIIjAxjki3XBGSd4RoDWaz20M7xbfo,89
2
+ kpass/generator.py,sha256=mAzf20YBrMvd3jALdqQnJR02J9Areq30FrZOM8X5GFs,3261
3
+ kpass_gen-0.1.1.dist-info/licenses/LICENSE.txt,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
4
+ kpass_gen-0.1.1.dist-info/METADATA,sha256=XGivFhxvLL7lhReBOHWY4g2qIn_2eR4-lgY0fBr5izU,1870
5
+ kpass_gen-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ kpass_gen-0.1.1.dist-info/top_level.txt,sha256=l8YfdoHutpiGNi7Zw-_bkGH48JGtmWU2Ac6nwvSb3dU,6
7
+ kpass_gen-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ kpass