password-wallet 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 imaguss
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,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: password-wallet
3
+ Version: 0.1.0
4
+ Summary: Administrador de billeteras porque soy imbecil y me olvido de la mayoria de contraseñas complejas
5
+ Author: imaguss
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/imaguss/password-wallet
8
+ Project-URL: Repository, https://github.com/imaguss/password-wallet
9
+ Keywords: password,wallet,clipboard,security
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Natural Language :: Spanish
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: cryptography>=49.0.0
26
+ Requires-Dist: pyperclip>=1.11.0
27
+ Dynamic: license-file
28
+
29
+ # Password Wallet
30
+
31
+ A CLI password manager that stores encrypted credentials and securely copies them to the clipboard, automatically clearing after 5 seconds.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install password-wallet
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```bash
42
+ # Create a new vault (first run)
43
+ password-wallet key_file vault_file
44
+
45
+ # Add a new password
46
+ password-wallet key_file vault_file --new-password
47
+
48
+ # List stored credentials
49
+ password-wallet key_file vault_file --list
50
+
51
+ # Search and copy a password
52
+ password-wallet key_file vault_file --search-pass "platform_name"
53
+
54
+ # Delete a credential
55
+ password-wallet key_file vault_file --delete-pass "platform_name"
56
+ ```
57
+
58
+ ## How it works
59
+
60
+ - Master password is derived using **Argon2id** (memory-hard KDF)
61
+ - Credentials are encrypted with **Fernet** (symmetric AES-128-CBC)
62
+ - Passwords are copied to clipboard and automatically cleared after 5 seconds
63
+ - Key file stores the Argon2 salt for password derivation
@@ -0,0 +1,35 @@
1
+ # Password Wallet
2
+
3
+ A CLI password manager that stores encrypted credentials and securely copies them to the clipboard, automatically clearing after 5 seconds.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install password-wallet
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Create a new vault (first run)
15
+ password-wallet key_file vault_file
16
+
17
+ # Add a new password
18
+ password-wallet key_file vault_file --new-password
19
+
20
+ # List stored credentials
21
+ password-wallet key_file vault_file --list
22
+
23
+ # Search and copy a password
24
+ password-wallet key_file vault_file --search-pass "platform_name"
25
+
26
+ # Delete a credential
27
+ password-wallet key_file vault_file --delete-pass "platform_name"
28
+ ```
29
+
30
+ ## How it works
31
+
32
+ - Master password is derived using **Argon2id** (memory-hard KDF)
33
+ - Credentials are encrypted with **Fernet** (symmetric AES-128-CBC)
34
+ - Passwords are copied to clipboard and automatically cleared after 5 seconds
35
+ - Key file stores the Argon2 salt for password derivation
@@ -0,0 +1,36 @@
1
+ import json
2
+ import sys
3
+
4
+ from pathlib import Path
5
+ from cryptography.fernet import Fernet, InvalidToken
6
+
7
+ class GestorArchivos:
8
+
9
+ @staticmethod
10
+ def cargar_archivo (ruta:Path,llave_maestra:Fernet) -> bytes:
11
+
12
+ if ruta.exists():
13
+ with open(file=ruta,mode='rb') as file:
14
+ try:
15
+ token:bytes = file.read()
16
+ archivo:bytes = llave_maestra.decrypt(token)
17
+ except InvalidToken as e:
18
+ print("Error: Incorrect master password.")
19
+ sys.exit(1)
20
+ else:
21
+ with open(file=ruta,mode='wb') as file:
22
+ token = llave_maestra.encrypt(data=b"[]")
23
+ file.write(token)
24
+ archivo = b"[]"
25
+
26
+ return archivo
27
+
28
+
29
+ @staticmethod
30
+ def guardar_cifrar_archivo(ruta:Path,archivo_desencriptado:list[dict[str,str]],llave_maestra:Fernet) -> None:
31
+
32
+ archivo:str = json.dumps(obj=archivo_desencriptado)
33
+ archivo_encriptado:bytes = llave_maestra.encrypt(data=archivo.encode(encoding='utf-8'))
34
+
35
+ with open(file=ruta,mode="wb") as file:
36
+ file.write(archivo_encriptado)
@@ -0,0 +1 @@
1
+ from .GestorArchivos import GestorArchivos
@@ -0,0 +1,32 @@
1
+ import base64
2
+ from pathlib import Path
3
+ from cryptography.hazmat.primitives.kdf.argon2 import Argon2id
4
+
5
+ class Llave:
6
+
7
+ @staticmethod
8
+ def obtener_llave(ruta:Path) -> bytes:
9
+
10
+ with open(file=ruta,mode='rb') as llave:
11
+ salto:bytes = llave.read()
12
+
13
+ return salto
14
+
15
+ @staticmethod
16
+ def guardar_llave(ruta:Path,salto:bytes) -> None:
17
+
18
+ with open(file=ruta,mode="wb") as llave:
19
+ _ = llave.write(salto)
20
+
21
+ @staticmethod
22
+ def crear_llave(contrasena:str,salto:bytes) -> bytes:
23
+ config:Argon2id = Argon2id(
24
+ salt= salto,
25
+ length=32,
26
+ iterations=3,
27
+ lanes=4,
28
+ memory_cost=2**16
29
+ )
30
+
31
+ llave:bytes = base64.urlsafe_b64encode(config.derive(contrasena.encode('utf-8')))
32
+ return llave
@@ -0,0 +1 @@
1
+ from .Llave import Llave
@@ -0,0 +1,88 @@
1
+ import json
2
+ import sys
3
+ import os
4
+ import time
5
+ import pyperclip
6
+
7
+ from password_wallet.Llaves.Llave import Llave
8
+ from password_wallet.Archivos.GestorArchivos import GestorArchivos
9
+ from pathlib import Path
10
+ from cryptography.fernet import Fernet
11
+
12
+ class Manejador:
13
+
14
+ def __init__(self,contrasena:str,ruta:Path,ruta_archivo:Path) -> None:
15
+ self.__llave_maestra:Fernet = Fernet(key=self.obtener_llave(contrasena,ruta))
16
+ self.__archivo_desencriptado:list[dict[str,str]] = json.loads(GestorArchivos.cargar_archivo(ruta=ruta_archivo,llave_maestra=self.__llave_maestra).decode(encoding='utf-8'))
17
+
18
+ def obtener_llave(self, contrasena:str, ruta:Path) -> bytes:
19
+ salto:bytes
20
+ llave:bytes
21
+
22
+ if ruta.exists():
23
+ salto = Llave.obtener_llave(ruta)
24
+ llave = Llave.crear_llave(contrasena,salto)
25
+ else:
26
+ salto = os.urandom(16)
27
+ Llave.guardar_llave(ruta,salto)
28
+ llave = Llave.crear_llave(contrasena,salto)
29
+
30
+ return llave
31
+
32
+ def guardar_cifrar_archivo(self,ruta:Path) -> None:
33
+ GestorArchivos.guardar_cifrar_archivo(ruta,archivo_desencriptado=self.__archivo_desencriptado,llave_maestra=self.__llave_maestra)
34
+
35
+ def cargar_contrasena(self, usuario:str,plataforma:str,contrasena:str) -> None:
36
+ self.__archivo_desencriptado.append({"usuario":usuario,"plataforma":plataforma,"contrasena":contrasena})
37
+
38
+ def mostrar_credenciales(self) -> None:
39
+
40
+ print(" Users and Platforms")
41
+ print("\u2500" * 40)
42
+
43
+ for credencial in self.__archivo_desencriptado:
44
+ print(f" User: {credencial["usuario"]}")
45
+ print(f" Platform: {credencial["plataforma"]}")
46
+ print("\u2500" * 40)
47
+
48
+ def buscar_contra(self, plataforma:str) -> tuple[int,list[list[str]]]:
49
+
50
+ indice:int = -1
51
+
52
+ contras:list[list[str]] = [[c["contrasena"],c["usuario"]]
53
+ for c in self.__archivo_desencriptado
54
+ if c["plataforma"].lower() == plataforma.lower()]
55
+
56
+ try:
57
+ if len(contras) > 1:
58
+ print(" Multiple users found. Select one:")
59
+ for i, usuario in enumerate(contras, start=1):
60
+ print(f" {i}. {usuario[1]}")
61
+ try:
62
+ indice = int(input("> ").strip())
63
+ except ValueError:
64
+ print(" Please enter a valid number.")
65
+ except IndexError:
66
+ print(" Selection out of range.")
67
+ else:
68
+ indice = 0
69
+ except IndexError:
70
+ print(" Password not found.")
71
+
72
+ return indice, contras
73
+
74
+ def copiar_al_portapapeles(self, timer:int, contra:str) -> None:
75
+
76
+ print(f" Password copied! Clearing in {timer} seconds...", end=" ", flush=True)
77
+ pyperclip.copy(text=contra)
78
+
79
+ for i in range(timer, 0, -1):
80
+ print(f"{i}...", end=" ", flush=True)
81
+ time.sleep(1)
82
+
83
+ print("\n Clipboard cleared.")
84
+ pyperclip.copy(text="")
85
+
86
+ def eliminar_contra(self, indice: int) -> None:
87
+ del self.__archivo_desencriptado[indice]
88
+ print(" Credential deleted successfully!")
@@ -0,0 +1 @@
1
+ from .Manejador import Manejador
@@ -0,0 +1,89 @@
1
+ import argparse
2
+ import getpass
3
+ import sys
4
+
5
+ from password_wallet import Manejador
6
+ from pathlib import Path
7
+
8
+
9
+ def argumentos() -> argparse.Namespace:
10
+ parser: argparse.ArgumentParser = argparse.ArgumentParser(
11
+ prog="Password Wallet",
12
+ description="A password wallet that stores credentials in the clipboard and clears them after 5 seconds.",
13
+ epilog="Thanks for using Password Wallet!",
14
+ )
15
+
16
+ parser.add_argument("Key", type=str, help="Path to the key file that encrypts your data.")
17
+ parser.add_argument("file", type=str, help="Path to the file containing the encrypted credentials.")
18
+
19
+ parser.add_argument("--new-password", "-n", action="store_true", help="Add a new credential to the vault.")
20
+ parser.add_argument("--list", "-l", action="store_true", help="List all stored usernames and platforms.")
21
+ parser.add_argument("--search-pass", "-s", help="Search and copy a password by platform name.")
22
+ parser.add_argument("--delete-pass", "-d", help="Delete a credential by platform name.")
23
+
24
+ args: argparse.Namespace = parser.parse_args()
25
+
26
+ return args
27
+
28
+
29
+ def crear_archivos(llave: Path, ruta: Path) -> None:
30
+ print(" Setting up a new password vault...")
31
+ print()
32
+ contrasena_verificar: str = getpass.getpass(prompt=" Master password: ")
33
+ contrasena_llave: str = getpass.getpass(prompt=" Master password (again): ")
34
+ if contrasena_verificar == contrasena_llave:
35
+ manejador: Manejador = Manejador(contrasena=contrasena_llave, ruta=llave, ruta_archivo=ruta)
36
+ print(" Vault created successfully!")
37
+ else:
38
+ print(" Passwords do not match.")
39
+ sys.exit(1)
40
+
41
+
42
+ def main(args: argparse.Namespace) -> None:
43
+ ruta: Path = Path(args.file)
44
+ llave: Path = Path(args.Key)
45
+ indice: int
46
+
47
+ if llave.is_file() and ruta.is_file():
48
+ contrasena_llave: str = getpass.getpass(prompt=" Master password: ")
49
+ elif llave.exists() and not llave.is_file():
50
+ print(" Error: key path is a directory.")
51
+ sys.exit(1)
52
+ elif ruta.exists() and not ruta.is_file():
53
+ print(" Error: data path is a directory.")
54
+ sys.exit(1)
55
+ else:
56
+ crear_archivos(llave, ruta)
57
+ contrasena_llave = getpass.getpass(prompt=" Master password: ")
58
+
59
+ manejador: Manejador = Manejador(contrasena=contrasena_llave, ruta=llave, ruta_archivo=ruta)
60
+
61
+ if args.search_pass:
62
+ indice, contras = manejador.buscar_contra(plataforma=args.search_pass)
63
+ manejador.copiar_al_portapapeles(timer=5, contra=contras[indice - 1][0])
64
+ if args.list:
65
+ manejador.mostrar_credenciales()
66
+ if args.new_password:
67
+ user: str = input("User: ").strip()
68
+ platform: str = input("Platform: ").strip()
69
+ contrasena_ingresada: str = getpass.getpass(prompt="Password: ")
70
+ contrasena: str = getpass.getpass(prompt="Password again: ")
71
+
72
+ if contrasena_ingresada == contrasena:
73
+ manejador.cargar_contrasena(usuario=user, plataforma=platform, contrasena=contrasena)
74
+ manejador.guardar_cifrar_archivo(ruta)
75
+ else:
76
+ print("Passwords do not match.")
77
+ sys.exit(1)
78
+ if args.delete_pass:
79
+ indice, _ = manejador.buscar_contra(plataforma=args.delete_pass)
80
+ manejador.eliminar_contra(indice)
81
+ manejador.guardar_cifrar_archivo(ruta)
82
+
83
+
84
+ def entry() -> None:
85
+ main(args=argumentos())
86
+
87
+
88
+ if __name__ == "__main__":
89
+ entry()
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: password-wallet
3
+ Version: 0.1.0
4
+ Summary: Administrador de billeteras porque soy imbecil y me olvido de la mayoria de contraseñas complejas
5
+ Author: imaguss
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/imaguss/password-wallet
8
+ Project-URL: Repository, https://github.com/imaguss/password-wallet
9
+ Keywords: password,wallet,clipboard,security
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Natural Language :: Spanish
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: cryptography>=49.0.0
26
+ Requires-Dist: pyperclip>=1.11.0
27
+ Dynamic: license-file
28
+
29
+ # Password Wallet
30
+
31
+ A CLI password manager that stores encrypted credentials and securely copies them to the clipboard, automatically clearing after 5 seconds.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install password-wallet
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```bash
42
+ # Create a new vault (first run)
43
+ password-wallet key_file vault_file
44
+
45
+ # Add a new password
46
+ password-wallet key_file vault_file --new-password
47
+
48
+ # List stored credentials
49
+ password-wallet key_file vault_file --list
50
+
51
+ # Search and copy a password
52
+ password-wallet key_file vault_file --search-pass "platform_name"
53
+
54
+ # Delete a credential
55
+ password-wallet key_file vault_file --delete-pass "platform_name"
56
+ ```
57
+
58
+ ## How it works
59
+
60
+ - Master password is derived using **Argon2id** (memory-hard KDF)
61
+ - Credentials are encrypted with **Fernet** (symmetric AES-128-CBC)
62
+ - Passwords are copied to clipboard and automatically cleared after 5 seconds
63
+ - Key file stores the Argon2 salt for password derivation
@@ -0,0 +1,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ password_wallet/Manejador.py
5
+ password_wallet/__init__.py
6
+ password_wallet/__main__.py
7
+ password_wallet.egg-info/PKG-INFO
8
+ password_wallet.egg-info/SOURCES.txt
9
+ password_wallet.egg-info/dependency_links.txt
10
+ password_wallet.egg-info/entry_points.txt
11
+ password_wallet.egg-info/requires.txt
12
+ password_wallet.egg-info/top_level.txt
13
+ password_wallet/Archivos/GestorArchivos.py
14
+ password_wallet/Archivos/__init__.py
15
+ password_wallet/Llaves/Llave.py
16
+ password_wallet/Llaves/__init__.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ password-wallet = password_wallet.__main__:entry
@@ -0,0 +1,2 @@
1
+ cryptography>=49.0.0
2
+ pyperclip>=1.11.0
@@ -0,0 +1 @@
1
+ password_wallet
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=75"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "password-wallet"
7
+ version = "0.1.0"
8
+ description = "Administrador de billeteras porque soy imbecil y me olvido de la mayoria de contraseñas complejas"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ authors = [
12
+ { name = "imaguss" }
13
+ ]
14
+ keywords = ["password", "wallet", "clipboard", "security"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Intended Audience :: End Users/Desktop",
19
+ "Natural Language :: Spanish",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Programming Language :: Python :: 3.14",
27
+ "Topic :: Security :: Cryptography",
28
+ ]
29
+ requires-python = ">=3.10"
30
+ dependencies = [
31
+ "cryptography>=49.0.0",
32
+ "pyperclip>=1.11.0",
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/imaguss/password-wallet"
37
+ Repository = "https://github.com/imaguss/password-wallet"
38
+
39
+ [project.scripts]
40
+ password-wallet = "password_wallet.__main__:entry"
41
+
42
+ [tool.setuptools.packages.find]
43
+ include = ["password_wallet", "password_wallet.*"]
44
+
45
+ [tool.basedpyright]
46
+ typeCheckingMode = "standard"
47
+ reportUnusedExpression = false
48
+ reportUnusedVariable = false
49
+ reportIncompatibleMethodOverride = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+