cryptologin 1.2__tar.gz → 2.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.
Files changed (40) hide show
  1. {cryptologin-1.2 → cryptologin-2.0}/PKG-INFO +33 -2
  2. {cryptologin-1.2 → cryptologin-2.0}/README.md +32 -1
  3. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/__init__.py +3 -2
  4. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/dependencies.py +1 -0
  5. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/routes/auth.py +1 -0
  6. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/routes/user.py +1 -0
  7. cryptologin-2.0/cryptologin/client/__init__.py +7 -0
  8. cryptologin-2.0/cryptologin/client/crypto_client.py +226 -0
  9. cryptologin-2.0/cryptologin/core/__init__.py +25 -0
  10. cryptologin-2.0/cryptologin/core/user_manager_v2.py +543 -0
  11. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/storage/__init__.py +4 -2
  12. cryptologin-2.0/cryptologin/storage/base.py +76 -0
  13. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/storage/memory.py +5 -4
  14. cryptologin-2.0/cryptologin/storage/sqlite_v2.py +294 -0
  15. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/PKG-INFO +33 -2
  16. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/SOURCES.txt +5 -1
  17. {cryptologin-1.2 → cryptologin-2.0}/pyproject.toml +1 -1
  18. cryptologin-1.2/cryptologin/core/__init__.py +0 -0
  19. cryptologin-1.2/cryptologin/storage/base.py +0 -113
  20. {cryptologin-1.2 → cryptologin-2.0}/LICENSE +0 -0
  21. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/__init__.py +0 -0
  22. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/models.py +0 -0
  23. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/routes/__init__.py +0 -0
  24. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/routes/health.py +0 -0
  25. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/api/routes/vault.py +0 -0
  26. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/cli.py +0 -0
  27. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/config.py +0 -0
  28. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/core/constants.py +0 -0
  29. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/core/crypto_engine.py +0 -0
  30. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/core/data_vault.py +0 -0
  31. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/core/exceptions.py +0 -0
  32. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/core/user_manager.py +0 -0
  33. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/main.py +0 -0
  34. {cryptologin-1.2 → cryptologin-2.0}/cryptologin/storage/sqlite.py +0 -0
  35. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/dependency_links.txt +0 -0
  36. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/entry_points.txt +0 -0
  37. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/requires.txt +0 -0
  38. {cryptologin-1.2 → cryptologin-2.0}/cryptologin.egg-info/top_level.txt +0 -0
  39. {cryptologin-1.2 → cryptologin-2.0}/setup.cfg +0 -0
  40. {cryptologin-1.2 → cryptologin-2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cryptologin
3
- Version: 1.2
3
+ Version: 2.0
4
4
  Summary: Passwordless without Password Storage Authentication System - No Email, No Password, Just Your Secret
5
5
  Author-email: erabytse <contact@fbfconsulting.org>
6
6
  Maintainer-email: erabytse <contact@fbfconsulting.org>
@@ -55,7 +55,7 @@ Dynamic: license-file
55
55
 
56
56
  # ![Passwordless Authentication without Password Storage](https://raw.githubusercontent.com/erabytse/CryptoLogin/main/images/logo.png)
57
57
 
58
- ## _Passwordless Authentication without Password Storage_
58
+ ## _Zero-Knowledge-Inspired Passwordless Authentication without Password Storage_
59
59
 
60
60
  **The Future of Authentication is Here. No Email. No Password. Just Your Secret.**
61
61
 
@@ -72,10 +72,25 @@ Dynamic: license-file
72
72
 
73
73
  <img src="https://raw.githubusercontent.com/erabytse/CryptoLogin/main/images/CryptoLogin.gif" width="320" height="170" alt="CryptoLogin"/>
74
74
 
75
+ CryptoLogin uses a challenge-response mechanism inspired by Zero-Knowledge principles.
76
+ The server never stores your secret. Your secret never leaves your device.
77
+
75
78
  </div>
76
79
 
77
80
  ---
78
81
 
82
+ ## 🛡️ Powered by Flash512-Vanguard
83
+
84
+ CryptoLogin is built on top of [Flash512-Vanguard](https://github.com/erabytse/Flash512-vanguard), a military-grade encryption engine:
85
+
86
+ - **AES-256-GCM** - NIST standard encryption
87
+ - **Argon2id** - Memory-hard key derivation (GPU/ASIC resistant)
88
+ - **SecureBuffer** - Automatic memory wiping of sensitive data
89
+
90
+ Flash512 handles all cryptographic operations, ensuring that CryptoLogin inherits battle-tested security from one of the most robust encryption libraries available.
91
+
92
+ ---
93
+
79
94
  ## 🚀 What is CryptoLogin?
80
95
 
81
96
  **CryptoLogin** is a revolutionary **Passwordless Authentication without Password Storage** that eliminates the need for emails, passwords, or social logins.
@@ -251,6 +266,22 @@ No asymmetric keys, no WebAuthn complexity, no email verification. Just Flash512
251
266
 
252
267
  If the database is compromised, attackers only get encrypted challenges. They must brute-force each user individually.
253
268
 
269
+ # Powered by Flash512-Vanguard
270
+
271
+ Flash512-Vanguard is the cryptographic engine behind CryptoLogin. It provides:
272
+
273
+ - AES-256-GCM: NIST-standard authenticated encryption
274
+
275
+ - Argon2id: Memory-hard key derivation
276
+
277
+ - SecureBuffer: Automatic memory wiping
278
+
279
+ - Polymorphic encryption: Same data, different ciphertext each time
280
+
281
+ - Integrity verification: GCM authentication tags
282
+
283
+ By building on Flash512, CryptoLogin inherits enterprise-grade security without implementing cryptographic primitives from scratch.
284
+
254
285
  ### Deployment Example (Web Application)
255
286
 
256
287
  ## Example 1
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Passwordless Authentication without Password Storage](https://raw.githubusercontent.com/erabytse/CryptoLogin/main/images/logo.png)
4
4
 
5
- ## _Passwordless Authentication without Password Storage_
5
+ ## _Zero-Knowledge-Inspired Passwordless Authentication without Password Storage_
6
6
 
7
7
  **The Future of Authentication is Here. No Email. No Password. Just Your Secret.**
8
8
 
@@ -19,10 +19,25 @@
19
19
 
20
20
  <img src="https://raw.githubusercontent.com/erabytse/CryptoLogin/main/images/CryptoLogin.gif" width="320" height="170" alt="CryptoLogin"/>
21
21
 
22
+ CryptoLogin uses a challenge-response mechanism inspired by Zero-Knowledge principles.
23
+ The server never stores your secret. Your secret never leaves your device.
24
+
22
25
  </div>
23
26
 
24
27
  ---
25
28
 
29
+ ## 🛡️ Powered by Flash512-Vanguard
30
+
31
+ CryptoLogin is built on top of [Flash512-Vanguard](https://github.com/erabytse/Flash512-vanguard), a military-grade encryption engine:
32
+
33
+ - **AES-256-GCM** - NIST standard encryption
34
+ - **Argon2id** - Memory-hard key derivation (GPU/ASIC resistant)
35
+ - **SecureBuffer** - Automatic memory wiping of sensitive data
36
+
37
+ Flash512 handles all cryptographic operations, ensuring that CryptoLogin inherits battle-tested security from one of the most robust encryption libraries available.
38
+
39
+ ---
40
+
26
41
  ## 🚀 What is CryptoLogin?
27
42
 
28
43
  **CryptoLogin** is a revolutionary **Passwordless Authentication without Password Storage** that eliminates the need for emails, passwords, or social logins.
@@ -198,6 +213,22 @@ No asymmetric keys, no WebAuthn complexity, no email verification. Just Flash512
198
213
 
199
214
  If the database is compromised, attackers only get encrypted challenges. They must brute-force each user individually.
200
215
 
216
+ # Powered by Flash512-Vanguard
217
+
218
+ Flash512-Vanguard is the cryptographic engine behind CryptoLogin. It provides:
219
+
220
+ - AES-256-GCM: NIST-standard authenticated encryption
221
+
222
+ - Argon2id: Memory-hard key derivation
223
+
224
+ - SecureBuffer: Automatic memory wiping
225
+
226
+ - Polymorphic encryption: Same data, different ciphertext each time
227
+
228
+ - Integrity verification: GCM authentication tags
229
+
230
+ By building on Flash512, CryptoLogin inherits enterprise-grade security without implementing cryptographic primitives from scratch.
231
+
201
232
  ### Deployment Example (Web Application)
202
233
 
203
234
  ## Example 1
@@ -7,7 +7,8 @@ __author__ = "CryptoLogin Team by erabytse"
7
7
  __license__ = "Apache-2.0"
8
8
 
9
9
  from .core.crypto_engine import CryptoEngine
10
- from .core.user_manager import UserManager
10
+ from .core.user_manager import UserManager
11
+ from .core.user_manager_v2 import UserManagerV2
11
12
  from .core.data_vault import DataVault
12
13
  from .core.exceptions import (
13
14
  CryptoLoginError,
@@ -37,7 +38,7 @@ class CryptoLogin:
37
38
  """
38
39
 
39
40
  def __init__(self, db_path: str = "cryptologin.db"):
40
- from .core.user_manager import UserManager
41
+ from .core.user_manager_v2 import UserManager
41
42
  from .storage.sqlite import SQLiteStorage
42
43
  from .core.crypto_engine import CryptoEngine
43
44
 
@@ -7,6 +7,7 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
7
7
  from fastapi.responses import JSONResponse
8
8
 
9
9
  from ..core.user_manager import UserManager
10
+ from ..core.user_manager_v2 import UserManagerV2
10
11
  from ..storage.sqlite import SQLiteStorage
11
12
  from ..config import get_settings, Settings
12
13
  from slowapi import Limiter
@@ -6,6 +6,7 @@ from fastapi import APIRouter, Depends, HTTPException, status, Request
6
6
  from fastapi.responses import JSONResponse
7
7
 
8
8
  from ...core.user_manager import UserManager
9
+ from ...core.user_manager_v2 import UserManagerV2
9
10
  from ...core.exceptions import (
10
11
  UserNotFoundError,
11
12
  UserAlreadyExistsError,
@@ -5,6 +5,7 @@ from typing import Any
5
5
  from fastapi import APIRouter, Depends, HTTPException, logger, status, Query, Request
6
6
 
7
7
  from ...core.user_manager import UserManager
8
+ from ...core.user_manager_v2 import UserManagerV2
8
9
  from ...core.exceptions import (
9
10
  UserNotFoundError,
10
11
  AuthenticationError,
@@ -0,0 +1,7 @@
1
+ """
2
+ CryptoLogin Client-Side Module
3
+ Provides cryptographic functions for browser/WASM environments
4
+ """
5
+ from .crypto_client import CryptoClient, WASMInterface
6
+
7
+ __all__ = ['CryptoClient', 'WASMInterface']
@@ -0,0 +1,226 @@
1
+ """
2
+ CryptoLogin Client-Side Cryptographic Module
3
+ Pure Python implementation for derivation and HMAC
4
+ (Will be compiled to WASM later)
5
+
6
+ This module implements the client-side cryptographic operations
7
+ that will run in the browser via WebAssembly.
8
+ """
9
+ import hashlib
10
+ import hmac
11
+ import secrets
12
+ from typing import Tuple, Optional
13
+ import base64
14
+
15
+
16
+ class CryptoClient:
17
+ """
18
+ Client-side cryptographic operations for CryptoLogin V2.
19
+ These functions are designed to run in the browser (via WASM).
20
+
21
+ All operations are deterministic and secure.
22
+ """
23
+
24
+ # Constants
25
+ PBKDF2_ITERATIONS = 100000
26
+ PBKDF2_SALT = b"cryptologin-v2-salt"
27
+ HMAC_ALGORITHM = hashlib.sha256
28
+ DERIVE_ALGORITHM = 'sha512'
29
+ DERIVE_KEY_LENGTH = 32
30
+
31
+ @classmethod
32
+ def derive_user_id(cls, master_secret: str) -> str:
33
+ """
34
+ Derive a user ID from the master secret.
35
+ Deterministic and secure.
36
+
37
+ Args:
38
+ master_secret: The master secret (minimum 32 characters)
39
+
40
+ Returns:
41
+ str: User ID (hexadecimal, 64 characters)
42
+
43
+ Example:
44
+ >>> user_id = CryptoClient.derive_user_id("my-secret")
45
+ >>> print(user_id)
46
+ "a1b2c3d4..."
47
+ """
48
+ if len(master_secret) < 32:
49
+ raise ValueError("Master secret must be at least 32 characters")
50
+
51
+ # PBKDF2-HMAC-SHA512 with 100,000 iterations
52
+ derived = hashlib.pbkdf2_hmac(
53
+ cls.DERIVE_ALGORITHM,
54
+ master_secret.encode('utf-8'),
55
+ cls.PBKDF2_SALT,
56
+ cls.PBKDF2_ITERATIONS,
57
+ dklen=cls.DERIVE_KEY_LENGTH
58
+ )
59
+ return derived.hex()
60
+
61
+ @classmethod
62
+ def generate_challenge(cls, length: int = 32) -> str:
63
+ """
64
+ Generate a random challenge.
65
+
66
+ Args:
67
+ length: Length of the challenge in bytes
68
+
69
+ Returns:
70
+ str: Hexadecimal challenge (length * 2 characters)
71
+
72
+ Example:
73
+ >>> challenge = CryptoClient.generate_challenge()
74
+ >>> print(challenge)
75
+ "f7e3a2b1c9d4e5f6..."
76
+ """
77
+ return secrets.token_hex(length)
78
+
79
+ @classmethod
80
+ def compute_hmac(cls, master_secret: str, challenge: str) -> str:
81
+ """
82
+ Compute HMAC-SHA256 of challenge using master_secret as key.
83
+ This is the cryptographic proof.
84
+
85
+ Args:
86
+ master_secret: The master secret
87
+ challenge: The challenge to sign
88
+
89
+ Returns:
90
+ str: HMAC signature (hexadecimal, 64 characters)
91
+
92
+ Example:
93
+ >>> signature = CryptoClient.compute_hmac("my-secret", "challenge")
94
+ >>> print(signature)
95
+ "4a5b6c7d8e9f..."
96
+ """
97
+ key = master_secret.encode('utf-8')
98
+ message = challenge.encode('utf-8')
99
+ signature = hmac.new(key, message, cls.HMAC_ALGORITHM).hexdigest()
100
+ return signature
101
+
102
+ @classmethod
103
+ def verify_hmac(cls, master_secret: str, challenge: str, signature: str) -> bool:
104
+ """
105
+ Verify HMAC signature.
106
+
107
+ Args:
108
+ master_secret: The master secret
109
+ challenge: The original challenge
110
+ signature: The signature to verify
111
+
112
+ Returns:
113
+ bool: True if signature is valid
114
+
115
+ Example:
116
+ >>> is_valid = CryptoClient.verify_hmac("my-secret", "challenge", signature)
117
+ >>> print(is_valid)
118
+ True
119
+ """
120
+ expected = cls.compute_hmac(master_secret, challenge)
121
+ return hmac.compare_digest(expected, signature)
122
+
123
+ @classmethod
124
+ def derive_vault_key(cls, master_secret: str, salt: Optional[str] = None) -> str:
125
+ """
126
+ Derive a key for the Data Vault.
127
+
128
+ Args:
129
+ master_secret: The master secret
130
+ salt: Optional salt (if not provided, use default)
131
+
132
+ Returns:
133
+ str: Derived key for the Vault
134
+ """
135
+ if not salt:
136
+ salt = cls.PBKDF2_SALT.decode('utf-8')
137
+
138
+ derived = hashlib.pbkdf2_hmac(
139
+ 'sha256',
140
+ master_secret.encode('utf-8'),
141
+ salt.encode('utf-8'),
142
+ 10000,
143
+ dklen=32
144
+ )
145
+ return derived.hex()
146
+
147
+ @classmethod
148
+ def secure_compare(cls, a: str, b: str) -> bool:
149
+ """
150
+ Constant-time string comparison.
151
+
152
+ Args:
153
+ a: First string
154
+ b: Second string
155
+
156
+ Returns:
157
+ bool: True if strings are equal
158
+ """
159
+ return hmac.compare_digest(a.encode('utf-8'), b.encode('utf-8'))
160
+
161
+
162
+ # ============================================================
163
+ # WEBASSEMBLY INTERFACE
164
+ # ============================================================
165
+
166
+ class WASMInterface:
167
+ """
168
+ Interface for WebAssembly compilation.
169
+ These functions will be exposed to JavaScript.
170
+
171
+ The functions are designed to be called from WASM.
172
+ """
173
+
174
+ @staticmethod
175
+ def wasm_derive_user_id(secret_ptr: int, secret_len: int) -> int:
176
+ """
177
+ WASM-compatible derive_user_id.
178
+
179
+ Args:
180
+ secret_ptr: Pointer to secret string
181
+ secret_len: Length of secret
182
+
183
+ Returns:
184
+ int: Pointer to derived ID string
185
+ """
186
+ # This will be implemented in C/Rust for WASM
187
+ # Python implementation for reference
188
+ pass
189
+
190
+ @staticmethod
191
+ def wasm_compute_hmac(secret_ptr: int, secret_len: int,
192
+ challenge_ptr: int, challenge_len: int) -> int:
193
+ """
194
+ WASM-compatible compute_hmac.
195
+
196
+ Args:
197
+ secret_ptr: Pointer to secret string
198
+ secret_len: Length of secret
199
+ challenge_ptr: Pointer to challenge string
200
+ challenge_len: Length of challenge
201
+
202
+ Returns:
203
+ int: Pointer to signature string
204
+ """
205
+ # This will be implemented in C/Rust for WASM
206
+ # Python implementation for reference
207
+ pass
208
+
209
+
210
+ # ============================================================
211
+ # UTILITY FUNCTIONS FOR JAVASCRIPT INTEGRATION
212
+ # ============================================================
213
+
214
+ def to_hex(bytes_data: bytes) -> str:
215
+ """Convert bytes to hexadecimal string."""
216
+ return bytes_data.hex()
217
+
218
+
219
+ def from_hex(hex_string: str) -> bytes:
220
+ """Convert hexadecimal string to bytes."""
221
+ return bytes.fromhex(hex_string)
222
+
223
+
224
+ def generate_salt(length: int = 32) -> str:
225
+ """Generate a random salt."""
226
+ return secrets.token_hex(length)
@@ -0,0 +1,25 @@
1
+ """
2
+ CryptoLogin Core Module
3
+ """
4
+ from .crypto_engine import CryptoEngine
5
+ from .user_manager import UserManager
6
+ from .user_manager_v2 import UserManagerV2
7
+ from .data_vault import DataVault
8
+ from .exceptions import *
9
+
10
+ __all__ = [
11
+ 'CryptoEngine',
12
+ 'UserManager',
13
+ 'UserManagerV2',
14
+ 'DataVault',
15
+ # Exceptions
16
+ 'CryptoLoginError',
17
+ 'CryptoError',
18
+ 'InvalidSecretError',
19
+ 'DecryptionError',
20
+ 'IntegrityError',
21
+ 'UserNotFoundError',
22
+ 'UserAlreadyExistsError',
23
+ 'AuthenticationError',
24
+ 'DataVaultError',
25
+ ]