foxkey 0.1.0__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.
cli.py ADDED
@@ -0,0 +1,246 @@
1
+ # cli.py
2
+ import argparse
3
+ import getpass
4
+ import sys
5
+ import time
6
+ import subprocess
7
+ from pathlib import Path
8
+ from urllib.parse import urlparse, parse_qs
9
+ from base64 import b32decode
10
+ import binascii
11
+
12
+ from core.storage import Vault
13
+ from core.totp import generate_totp
14
+
15
+ def sanitize_and_validate_secret(secret_input: str) -> dict:
16
+ """Returns {'secret': str, 'algorithm': str, 'digits': int, 'period': int}."""
17
+ cleaned = secret_input.strip()
18
+ config = {"algorithm": "SHA1", "digits": 6, "period": 30}
19
+
20
+ if cleaned.lower().startswith("otpauth://"):
21
+ try:
22
+ parsed_url = urlparse(cleaned)
23
+ query_params = parse_qs(parsed_url.query)
24
+ if 'secret' not in query_params:
25
+ raise ValueError("The provided otpauth URI is missing a '?secret=' parameter.")
26
+ cleaned = query_params['secret'][0]
27
+ if 'algorithm' in query_params:
28
+ config["algorithm"] = query_params['algorithm'][0].upper()
29
+ if 'digits' in query_params:
30
+ config["digits"] = int(query_params['digits'][0])
31
+ if 'period' in query_params:
32
+ config["period"] = int(query_params['period'][0])
33
+ except Exception as e:
34
+ raise ValueError(f"Failed parsing token URI schema: {e}")
35
+
36
+ validation_target = cleaned.upper().replace(' ', '').replace('-', '')
37
+ missing_padding = len(validation_target) % 8
38
+ if missing_padding:
39
+ validation_target += '=' * (8 - missing_padding)
40
+
41
+ try:
42
+ b32decode(validation_target)
43
+ except binascii.Error:
44
+ raise ValueError(
45
+ f"Invalid character signature found!\n"
46
+ f"Expected standard Base32 layout (A-Z, 2-7).\n"
47
+ f"Supplied raw string input was: {secret_input[:15]}..."
48
+ )
49
+
50
+ if config["algorithm"] not in ("SHA1", "SHA256", "SHA512"):
51
+ raise ValueError(f"Unsupported algorithm '{config['algorithm']}'.")
52
+ if not (6 <= config["digits"] <= 10):
53
+ raise ValueError("Digits must be between 6 and 10.")
54
+ if config["period"] <= 0:
55
+ raise ValueError("Period must be a positive number of seconds.")
56
+
57
+ config["secret"] = cleaned
58
+ return config
59
+
60
+ def copy_to_clipboard(text: str):
61
+ try:
62
+ if sys.platform == "darwin":
63
+ subprocess.run(["pbcopy"], input=text.encode(), check=True)
64
+ elif sys.platform == "linux":
65
+ if subprocess.run(["which", "termux-clipboard-set"], capture_output=True).returncode == 0:
66
+ subprocess.run(["termux-clipboard-set", text], check=True)
67
+ else:
68
+ subprocess.run(["xclip", "-selection", "clipboard"], input=text.encode(), check=True)
69
+ elif sys.platform == "win32":
70
+ subprocess.run(["clip"], input=text.encode(), check=True)
71
+ except Exception:
72
+ pass
73
+
74
+ def clear_clipboard():
75
+ copy_to_clipboard("")
76
+
77
+ def draw_progress_bar(remaining_seconds: int, total_steps: int = 30, bar_width: int = 20):
78
+ """Renders a clean standard output carriage-return visual progress monitor."""
79
+ remaining_seconds = max(0, remaining_seconds)
80
+ filled_length = int(round(bar_width * remaining_seconds / total_steps))
81
+ bar = '█' * filled_length + '-' * (bar_width - filled_length)
82
+ sys.stdout.write(f"\rTime Remaining: [{bar}] {remaining_seconds:2d}s before auto-wipe...")
83
+ sys.stdout.flush()
84
+
85
+ def main():
86
+ parser = argparse.ArgumentParser(prog="foxkey", description="Secure terminal 2FA manager.")
87
+ subparsers = parser.add_subparsers(dest="cmd", required=True)
88
+
89
+ subparsers.add_parser("list", help="List all vault service names.")
90
+
91
+ add_p = subparsers.add_parser("add", help="Add a new 2FA service credential.")
92
+ add_p.add_argument("name", help="Account or provider tracking name.")
93
+ add_p.add_argument("secret", help="Base32 seed or full otpauth:// URI.")
94
+ add_p.add_argument("--algorithm", choices=["SHA1", "SHA256", "SHA512"],
95
+ help="Override HMAC algorithm (default: SHA1, or value from otpauth URI).")
96
+ add_p.add_argument("--digits", type=int,
97
+ help="Override token length (default: 6, or value from otpauth URI).")
98
+ add_p.add_argument("--period", type=int,
99
+ help="Override time step in seconds (default: 30, or value from otpauth URI).")
100
+
101
+ get_p = subparsers.add_parser("get", help="Generate code and copy to clipboard.")
102
+ get_p.add_argument("name", help="Name of account target.")
103
+
104
+ rem_p = subparsers.add_parser("remove", help="Permanently drop a service key.")
105
+ rem_p.add_argument("name", help="Name of target account profile to erase.")
106
+
107
+ # NEW: Added change-password subparser
108
+ subparsers.add_parser("change-password", help="Update vault master password key.")
109
+
110
+ exp_p = subparsers.add_parser("export", help="Export encrypted vault backup.")
111
+ exp_p.add_argument("--file", default=str(Path.home() / "foxkey-backup.enc"))
112
+
113
+ imp_p = subparsers.add_parser("import", help="Import from encrypted backup.")
114
+ imp_p.add_argument("file", help="Backup file path.")
115
+
116
+ args = parser.parse_args()
117
+
118
+ if args.cmd == "add":
119
+ try:
120
+ totp_config = sanitize_and_validate_secret(args.secret)
121
+ except ValueError as err:
122
+ print(f"Validation Error: {err}", file=sys.stderr)
123
+ sys.exit(1)
124
+ if args.algorithm:
125
+ totp_config["algorithm"] = args.algorithm
126
+ if args.digits:
127
+ totp_config["digits"] = args.digits
128
+ if args.period:
129
+ totp_config["period"] = args.period
130
+
131
+ vault = Vault()
132
+
133
+ if args.cmd == "list":
134
+ labels = vault.get_public_labels()
135
+ if not labels:
136
+ print("Vault is entirely empty.")
137
+ for service in labels:
138
+ print(f"- {service}")
139
+ sys.exit(0)
140
+
141
+ # Prompt for current password first to unlock entries database
142
+ password = getpass.getpass("Master Password: ")
143
+ if not vault.load(password):
144
+ print("Error: Invalid master password.", file=sys.stderr)
145
+ sys.exit(1)
146
+
147
+ if args.cmd == "add":
148
+ if args.name in vault.entries:
149
+ confirm = input(f"'{args.name}' already exists — overwrite? [y/N]: ").strip().lower()
150
+ if confirm != "y":
151
+ print("Aborted: existing entry left unchanged.")
152
+ sys.exit(0)
153
+ vault.entries[args.name] = totp_config
154
+ vault.save(password)
155
+ print(f"Success: Validated credential for '{args.name}' successfully archived.")
156
+
157
+ elif args.cmd == "remove":
158
+ if args.name not in vault.entries:
159
+ print(f"Error: Profile name '{args.name}' not found.", file=sys.stderr)
160
+ sys.exit(1)
161
+ del vault.entries[args.name]
162
+ vault.save(password)
163
+ print(f"Success: Key profile '{args.name}' has been permanently dropped.")
164
+
165
+ # NEW: Added password mutation execution branch
166
+ elif args.cmd == "change-password":
167
+ new_password = getpass.getpass("Enter New Master Password: ")
168
+ confirm_password = getpass.getpass("Confirm New Master Password: ")
169
+
170
+ if new_password != confirm_password:
171
+ print("Error: Passwords do not match. Aborting mutation.", file=sys.stderr)
172
+ sys.exit(1)
173
+
174
+ if not new_password.strip():
175
+ print("Error: Password cannot be blank.", file=sys.stderr)
176
+ sys.exit(1)
177
+
178
+ # Write out using the confirmed new encryption key profile
179
+ vault.save(new_password)
180
+ print("Success: Vault re-encrypted under your fresh master password blueprint.")
181
+
182
+ elif args.cmd == "export":
183
+ try:
184
+ vault.export_backup(Path(args.file))
185
+ except FileNotFoundError as err:
186
+ print(f"Error: {err}", file=sys.stderr)
187
+ sys.exit(1)
188
+
189
+ elif args.cmd == "import":
190
+ existing_count = len(vault.entries)
191
+ if existing_count:
192
+ confirm = input(
193
+ f"Importing will overwrite your current vault ({existing_count} entries) "
194
+ f"with the contents of the backup. Continue? [y/N]: "
195
+ ).strip().lower()
196
+ if confirm != "y":
197
+ print("Aborted: current vault left unchanged.")
198
+ sys.exit(0)
199
+ try:
200
+ vault.import_backup(Path(args.file), password)
201
+ except ValueError:
202
+ # Backup may be encrypted under a different password than the
203
+ # current vault (e.g. disaster recovery, or a stale backup).
204
+ backup_password = getpass.getpass("Backup Master Password: ")
205
+ try:
206
+ vault.import_backup(Path(args.file), backup_password)
207
+ except (FileNotFoundError, ValueError) as err:
208
+ print(f"Error: {err}", file=sys.stderr)
209
+ sys.exit(1)
210
+ except FileNotFoundError as err:
211
+ print(f"Error: {err}", file=sys.stderr)
212
+ sys.exit(1)
213
+
214
+ elif args.cmd == "get":
215
+ if args.name not in vault.entries:
216
+ print(f"Error: Profile name '{args.name}' not found.", file=sys.stderr)
217
+ sys.exit(1)
218
+
219
+ entry = vault.entries[args.name]
220
+ secret = entry["secret"]
221
+ algorithm = entry.get("algorithm", "SHA1")
222
+ digits = entry.get("digits", 6)
223
+ time_step = entry.get("period", 30)
224
+
225
+ token = generate_totp(secret, time_step=time_step, digits=digits, algorithm=algorithm)
226
+
227
+ copy_to_clipboard(token)
228
+ print(f"Token: {token}")
229
+ print("Note: Token copied directly to your clipboard ecosystem.")
230
+
231
+ try:
232
+ while True:
233
+ now = int(time.time())
234
+ remaining = time_step - (now % time_step)
235
+ draw_progress_bar(remaining, total_steps=time_step)
236
+
237
+ if remaining <= 1:
238
+ time.sleep(0.5)
239
+ draw_progress_bar(0, total_steps=time_step)
240
+ break
241
+ time.sleep(0.5)
242
+ except KeyboardInterrupt:
243
+ pass
244
+ finally:
245
+ clear_clipboard()
246
+ print("\nClipboard cleared. Token cycle window has successfully closed.")
core/__init__.py ADDED
File without changes
core/crypto.py ADDED
@@ -0,0 +1,36 @@
1
+ # core/crypto.py
2
+ import os
3
+ from cryptography.hazmat.primitives.kdf.argon2 import Argon2id
4
+ from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
5
+
6
+ SALT_SIZE = 16
7
+ KEY_SIZE = 32
8
+ NONCE_SIZE = 12
9
+
10
+ def derive_key(master_password: str, salt: bytes = None) -> tuple[bytes, bytes]:
11
+ """Derives a key from password using Argon2id, generating salt if missing."""
12
+ if salt is None:
13
+ salt = os.urandom(SALT_SIZE)
14
+ kdf = Argon2id(
15
+ length=KEY_SIZE,
16
+ salt=salt,
17
+ iterations=2,
18
+ memory_cost=64 * 1024, # 64 MiB (safe for mobile load profiles)
19
+ lanes=4
20
+ )
21
+ key = kdf.derive(master_password.encode('utf-8'))
22
+ return key, salt
23
+
24
+ def encrypt(data: bytes, key: bytes) -> bytes:
25
+ """Encrypts payload using ChaCha20Poly1305 AEAD."""
26
+ nonce = os.urandom(NONCE_SIZE)
27
+ cipher = ChaCha20Poly1305(key)
28
+ ciphertext = cipher.encrypt(nonce, data, None)
29
+ return nonce + ciphertext
30
+
31
+ def decrypt(encrypted: bytes, key: bytes) -> bytes:
32
+ """Decrypts payload using ChaCha20Poly1305 AEAD."""
33
+ nonce = encrypted[:NONCE_SIZE]
34
+ ciphertext = encrypted[NONCE_SIZE:]
35
+ cipher = ChaCha20Poly1305(key)
36
+ return cipher.decrypt(nonce, ciphertext, None)
core/storage.py ADDED
@@ -0,0 +1,85 @@
1
+ # core/storage.py
2
+ import json
3
+ import os
4
+ import struct
5
+ import shutil
6
+ from pathlib import Path
7
+ from cryptography.exceptions import InvalidTag
8
+ from .crypto import derive_key, encrypt, decrypt, SALT_SIZE
9
+
10
+ VAULT_PATH = Path.home() / ".foxkey" / "vault.enc"
11
+
12
+ class Vault:
13
+ def __init__(self):
14
+ self.entries = {}
15
+
16
+ def get_public_labels(self) -> list[str]:
17
+ if not VAULT_PATH.exists():
18
+ return []
19
+ try:
20
+ payload = VAULT_PATH.read_bytes()
21
+ if len(payload) < SALT_SIZE + 4:
22
+ return []
23
+ header_len = struct.unpack('>I', payload[SALT_SIZE:SALT_SIZE+4])[0]
24
+ header_bytes = payload[SALT_SIZE+4 : SALT_SIZE+4+header_len]
25
+ return json.loads(header_bytes.decode('utf-8'))
26
+ except Exception:
27
+ return []
28
+
29
+ def load(self, master_password: str, path: Path = None) -> bool:
30
+ path = path or VAULT_PATH
31
+ if not path.exists():
32
+ return True
33
+ payload = path.read_bytes()
34
+ if len(payload) < SALT_SIZE + 4:
35
+ raise ValueError("Corrupt vault file.")
36
+
37
+ salt = payload[:SALT_SIZE]
38
+ header_len = struct.unpack('>I', payload[SALT_SIZE:SALT_SIZE+4])[0]
39
+ encrypted_data = payload[SALT_SIZE + 4 + header_len:]
40
+
41
+ if not encrypted_data:
42
+ raise ValueError("Corrupt vault file: ciphertext block missing.")
43
+
44
+ key, _ = derive_key(master_password, salt)
45
+ try:
46
+ decrypted = decrypt(encrypted_data, key)
47
+ self.entries = json.loads(decrypted.decode('utf-8'))
48
+ return True
49
+ except InvalidTag:
50
+ return False
51
+
52
+ def save(self, master_password: str):
53
+ key, salt = derive_key(master_password, None)
54
+ labels = list(self.entries.keys())
55
+ header_bytes = json.dumps(labels).encode('utf-8')
56
+ header_len_bytes = struct.pack('>I', len(header_bytes))
57
+
58
+ raw_json = json.dumps(self.entries).encode('utf-8')
59
+ encrypted_data = encrypt(raw_json, key)
60
+
61
+ VAULT_PATH.parent.mkdir(parents=True, exist_ok=True)
62
+ VAULT_PATH.write_bytes(salt + header_len_bytes + header_bytes + encrypted_data)
63
+
64
+ def export_backup(self, backup_path: Path):
65
+ """Simple secure export - just copy the encrypted vault."""
66
+ if not VAULT_PATH.exists():
67
+ raise FileNotFoundError("Nothing to export.")
68
+ backup_path.parent.mkdir(parents=True, exist_ok=True)
69
+ shutil.copy2(VAULT_PATH, backup_path)
70
+ print(f"✅ Vault exported to: {backup_path}")
71
+
72
+ def import_backup(self, backup_path: Path, master_password: str):
73
+ """Import backup and re-encrypt under current (or new) password."""
74
+ if not backup_path.exists():
75
+ raise FileNotFoundError(f"Backup not found: {backup_path}")
76
+
77
+ temp = Vault()
78
+ success = temp.load(master_password, path=backup_path)
79
+
80
+ if not success:
81
+ raise ValueError("Invalid master password for this backup.")
82
+
83
+ self.entries = temp.entries
84
+ self.save(master_password)
85
+ print(f"✅ Successfully imported from {backup_path}")
core/totp.py ADDED
@@ -0,0 +1,36 @@
1
+ # core/totp.py
2
+ import hashlib
3
+ import hmac
4
+ import struct
5
+ import time
6
+ from base64 import b32decode
7
+
8
+ _ALGORITHMS = {
9
+ "SHA1": hashlib.sha1,
10
+ "SHA256": hashlib.sha256,
11
+ "SHA512": hashlib.sha512,
12
+ }
13
+
14
+ def generate_totp(secret: str, time_step: int = 30, digits: int = 6, algorithm: str = "SHA1") -> str:
15
+ """Generates an RFC 6238 TOTP token with clean base32 padding."""
16
+ clean_secret = secret.upper().replace(' ', '')
17
+ missing_padding = len(clean_secret) % 8
18
+ if missing_padding:
19
+ clean_secret += '=' * (8 - missing_padding)
20
+
21
+ key = b32decode(clean_secret)
22
+ counter = int(time.time()) // time_step
23
+ return hotp(key, counter, digits, algorithm)
24
+
25
+ def hotp(key: bytes, counter: int, digits: int = 6, algorithm: str = "SHA1") -> str:
26
+ """Generates an RFC 4226 HOTP token value."""
27
+ digestmod = _ALGORITHMS.get(algorithm.upper())
28
+ if digestmod is None:
29
+ raise ValueError(
30
+ f"Unsupported algorithm '{algorithm}'. Choose from: {', '.join(_ALGORITHMS)}"
31
+ )
32
+ counter_bytes = struct.pack('>Q', counter)
33
+ hmac_hash = hmac.new(key, counter_bytes, digestmod).digest()
34
+ offset = hmac_hash[-1] & 0x0F
35
+ binary = struct.unpack('>I', hmac_hash[offset:offset+4])[0] & 0x7FFFFFFF
36
+ return str(binary % (10 ** digits)).zfill(digits)
@@ -0,0 +1,61 @@
1
+ Metadata-Version: 2.4
2
+ Name: foxkey
3
+ Version: 0.1.0
4
+ Summary: Secure, dependency-light TOTP 2FA manager with zero footguns.
5
+ License-Expression: MIT
6
+ Project-URL: Source, https://github.com/foxhackerzdevs/foxkey
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: cryptography>=42.0.0
11
+ Dynamic: license-file
12
+
13
+ # 🦊 FoxKey — Secure TOTP Manager
14
+
15
+ Minimalist, secure terminal 2FA client with strong defaults and zero footguns.
16
+
17
+ ## Features
18
+ - Encrypted vault (Argon2id + ChaCha20-Poly1305)
19
+ - Plaintext label index (list without password)
20
+ - otpauth:// URI support
21
+ - Clipboard auto-clear + live countdown
22
+ - Export / Import encrypted backups
23
+ - Change master password
24
+ - BusyBox-style single script
25
+
26
+ ## Installation
27
+
28
+ **From PyPI**
29
+ ```bash
30
+ pip install foxkey
31
+ ```
32
+
33
+ **Single binary (recommended)**
34
+ ```bash
35
+ pip install pyinstaller
36
+ pyinstaller --onefile --name foxkey foxkey.py
37
+ # Move dist/foxkey to ~/bin or /usr/local/bin
38
+ ```
39
+
40
+ **Development**
41
+ ```bash
42
+ git clone ... && cd foxkey
43
+ pip install -e .
44
+ ```
45
+
46
+ ## Usage
47
+ ```bash
48
+ foxkey add github otpauth://totp/...
49
+ foxkey list
50
+ foxkey get github
51
+ foxkey export --file backup.enc
52
+ foxkey import backup.enc
53
+ foxkey change-password
54
+ ```
55
+
56
+ ## Security Notes
57
+ - Master password never touches CLI args
58
+ - Vault refuses weak operations
59
+ - Clipboard cleared after token lifetime
60
+
61
+ ---
@@ -0,0 +1,12 @@
1
+ cli.py,sha256=1FzW-3R04tydXxB52OKfymIVjuA-WKp8MVz2lDq1Ucs,10096
2
+ foxkey.py,sha256=AmIEjGdJM4fzGbeLLF6WYhMu2IxXtCBUyl62kt9zBPc,309
3
+ core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ core/crypto.py,sha256=gdW9JceKBGthatN1zGmNRfCZZFZ_fM9OwavgVqAkPCo,1212
5
+ core/storage.py,sha256=E8LNT0xMAk4B3IcccCh-Jxd0bVgJLfqThORG0zzaelU,3113
6
+ core/totp.py,sha256=yJZL28KwziP8pZGGESKRbIQ-UQ02LtK-p5XZPGLFRnU,1290
7
+ foxkey-0.1.0.dist-info/licenses/LICENSE,sha256=p1OSXnJheNJK39gGLrV1Q4tD6bRP_UYYl_mQvp1_YNY,1068
8
+ foxkey-0.1.0.dist-info/METADATA,sha256=5S81eTGpQNst2npFkLjK1UyvFPqyBocvrWLhYChTSmk,1339
9
+ foxkey-0.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
10
+ foxkey-0.1.0.dist-info/entry_points.txt,sha256=ajiUZimc8lcPxAsMYTN-ySLtRZqBNBkx12mXECPyjCo,39
11
+ foxkey-0.1.0.dist-info/top_level.txt,sha256=0Mrr3b0_zLyIl49jx-qquqF8bsXdPsvEvneFV5W_evM,16
12
+ foxkey-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ foxkey = foxkey:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fox Hackerz
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,3 @@
1
+ cli
2
+ core
3
+ foxkey
foxkey.py ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env python3
2
+ import sys
3
+ import os
4
+
5
+ sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
6
+
7
+ from cli import main
8
+
9
+ if __name__ == "__main__":
10
+ try:
11
+ main()
12
+ except KeyboardInterrupt:
13
+ print("\nOperation cancelled.")
14
+ sys.exit(1)
15
+ finally:
16
+ sys.path.pop(0)