sqrypt-cyber-sdk 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,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqrypt-cyber-sdk
3
+ Version: 0.1.0
4
+ Summary: Enterprise Hybrid Post-Quantum Cryptography SDK wrapping NIST FIPS-203 (ML-KEM)
5
+ Author-email: Aryan Sujay <your.email@example.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Classifier: Topic :: Security :: Cryptography
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: requests>=2.31.0
13
+
14
+ # SQrypt Post-Quantum Cybersecurity SDK 🛡️
15
+
16
+ SQrypt is an enterprise-grade developer kit designed to secure high-stakes data ingestion layers against future quantum threats. It provides an optimized, drop-in abstraction layer wrapping **NIST FIPS-203 (ML-KEM)** lattice cryptography.
17
+
18
+ ## Key Features
19
+ * **One-Line Implementation:** Secure runtime data routing via native Python decorators.
20
+ * **Hybrid Defense Architecture:** Merges classical AES-256-GCM symmetric block ciphers with post-quantum asymmetric encapsulation.
21
+ * **Zero-Knowledge Target Mutation:** Secure specific nested keys within complex JSON payloads without exposing metadata.
22
+
23
+ ## Installation
24
+ ```bash
25
+ pip install sqrypt-cyber-sdk
26
+ ```
27
+
28
+ ## Quick Start Guide
29
+ * **Initialize the Secure Client:** Connect the SDK to your isolated enterprise infrastructure instance by instantiating the client engine with your secret keys:
30
+ ```bash
31
+ from sqrypt import SQryptClient
32
+
33
+ client = SQryptClient(
34
+ server_url="[http://127.0.0.1:8500](http://127.0.0.1:8500)",
35
+ api_key="YOUR_ENTERPRISE_API_KEY"
36
+ )
37
+ ```
38
+
39
+ * **Runtime Interception (Pattern A):** Protect live string streams dynamically at the functional boundary using the automatic encryption decorator:
40
+ ```bash
41
+ @client.auto_encrypt()
42
+ def process_runtime_transaction(user_id: str, card_data: str) -> str:
43
+ # Data is automatically encapsulated before network dispatch
44
+ return f"USER:{user_id}|RAW_CARD:{card_data}"
45
+
46
+ # Executes lattice-based key encapsulation
47
+ protected_payload = process_runtime_transaction("usr_998", "4111-2222-3333-4444")
48
+
49
+ # Reclaim the plaintext string through zero-knowledge decapsulation
50
+ recovered_string = client.decrypt(protected_payload)
51
+ ```
52
+
53
+ * **Granular Field Masking (Pattern B):** To protect structural records or transactional documents before database insertion, mask target keys selectively:
54
+ ```bash
55
+ database_document = {
56
+ "account_id": "acc_001",
57
+ "status": "active",
58
+ "tax_id": "999-12-3456",
59
+ "secret_token": "token_xyz123"
60
+ }
61
+
62
+ # Mutates specified targets into quantum-secure ciphertext bundles
63
+ masked_document = client.protect_dict(
64
+ data=database_document,
65
+ sensitive_keys=["tax_id", "secret_token"]
66
+ )
67
+ ```
68
+
69
+ ## SECURITY SPECIFICATIONS
70
+ SQrypt's design parameters conform strictly to the modern cryptographic primitives evaluated by the National Institute of Standards and Technology (NIST):
71
+ | Layer / Algorithm / Standard | Target Bit Security | Notes / Details |
72
+ |-------------------------------------|------------------------------|-----------------------------------|
73
+ | Asymmetric Key Encapsulation | ML-KEM-768 (FIPS 203) | 192-bit (Quantum-Secure) |
74
+ | Symmetric Bulk Encryption | AES-256-GCM | 256-bit (Classical/Quantum-Safe) |
75
+ | Key Derivation Function | HKDF-SHA256 | High-Entropy Expansion |
76
+
77
+
78
+ ## License
79
+ This SDK is distributed under the terms of the MIT License.
@@ -0,0 +1,66 @@
1
+ # SQrypt Post-Quantum Cybersecurity SDK 🛡️
2
+
3
+ SQrypt is an enterprise-grade developer kit designed to secure high-stakes data ingestion layers against future quantum threats. It provides an optimized, drop-in abstraction layer wrapping **NIST FIPS-203 (ML-KEM)** lattice cryptography.
4
+
5
+ ## Key Features
6
+ * **One-Line Implementation:** Secure runtime data routing via native Python decorators.
7
+ * **Hybrid Defense Architecture:** Merges classical AES-256-GCM symmetric block ciphers with post-quantum asymmetric encapsulation.
8
+ * **Zero-Knowledge Target Mutation:** Secure specific nested keys within complex JSON payloads without exposing metadata.
9
+
10
+ ## Installation
11
+ ```bash
12
+ pip install sqrypt-cyber-sdk
13
+ ```
14
+
15
+ ## Quick Start Guide
16
+ * **Initialize the Secure Client:** Connect the SDK to your isolated enterprise infrastructure instance by instantiating the client engine with your secret keys:
17
+ ```bash
18
+ from sqrypt import SQryptClient
19
+
20
+ client = SQryptClient(
21
+ server_url="[http://127.0.0.1:8500](http://127.0.0.1:8500)",
22
+ api_key="YOUR_ENTERPRISE_API_KEY"
23
+ )
24
+ ```
25
+
26
+ * **Runtime Interception (Pattern A):** Protect live string streams dynamically at the functional boundary using the automatic encryption decorator:
27
+ ```bash
28
+ @client.auto_encrypt()
29
+ def process_runtime_transaction(user_id: str, card_data: str) -> str:
30
+ # Data is automatically encapsulated before network dispatch
31
+ return f"USER:{user_id}|RAW_CARD:{card_data}"
32
+
33
+ # Executes lattice-based key encapsulation
34
+ protected_payload = process_runtime_transaction("usr_998", "4111-2222-3333-4444")
35
+
36
+ # Reclaim the plaintext string through zero-knowledge decapsulation
37
+ recovered_string = client.decrypt(protected_payload)
38
+ ```
39
+
40
+ * **Granular Field Masking (Pattern B):** To protect structural records or transactional documents before database insertion, mask target keys selectively:
41
+ ```bash
42
+ database_document = {
43
+ "account_id": "acc_001",
44
+ "status": "active",
45
+ "tax_id": "999-12-3456",
46
+ "secret_token": "token_xyz123"
47
+ }
48
+
49
+ # Mutates specified targets into quantum-secure ciphertext bundles
50
+ masked_document = client.protect_dict(
51
+ data=database_document,
52
+ sensitive_keys=["tax_id", "secret_token"]
53
+ )
54
+ ```
55
+
56
+ ## SECURITY SPECIFICATIONS
57
+ SQrypt's design parameters conform strictly to the modern cryptographic primitives evaluated by the National Institute of Standards and Technology (NIST):
58
+ | Layer / Algorithm / Standard | Target Bit Security | Notes / Details |
59
+ |-------------------------------------|------------------------------|-----------------------------------|
60
+ | Asymmetric Key Encapsulation | ML-KEM-768 (FIPS 203) | 192-bit (Quantum-Secure) |
61
+ | Symmetric Bulk Encryption | AES-256-GCM | 256-bit (Classical/Quantum-Safe) |
62
+ | Key Derivation Function | HKDF-SHA256 | High-Entropy Expansion |
63
+
64
+
65
+ ## License
66
+ This SDK is distributed under the terms of the MIT License.
@@ -0,0 +1,26 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sqrypt-cyber-sdk"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name = "Aryan Sujay", email = "your.email@example.com" }
10
+ ]
11
+ description = "Enterprise Hybrid Post-Quantum Cryptography SDK wrapping NIST FIPS-203 (ML-KEM)"
12
+ readme = "README.md"
13
+ requires-python = ">=3.11"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Topic :: Security :: Cryptography",
19
+ ]
20
+ dependencies = [
21
+ "requests>=2.31.0",
22
+ ]
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = ["."]
26
+ include = ["sqrypt*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from .client import SQryptClient, SQryptPayload
@@ -0,0 +1,118 @@
1
+ import requests
2
+ import base64
3
+ import os
4
+ from functools import wraps
5
+ from dataclasses import dataclass, asdict
6
+ from typing import Union, Dict, List, Callable
7
+ from cryptography.hazmat.primitives.ciphers.aead import AESGCM
8
+
9
+ @dataclass
10
+ class SQryptPayload:
11
+ ciphertext: str
12
+ nonce: str
13
+ capsule: str
14
+
15
+ def to_dict(self) -> Dict[str, str]:
16
+ """Serializes payload into a standard JSON-compatible dictionary."""
17
+ return asdict(self)
18
+
19
+
20
+ class SQryptClient:
21
+ def __init__(self, server_url: str, api_key: str):
22
+ """Initializes the SDK client with network connection pooling."""
23
+ self.server_url = server_url.rstrip('/')
24
+ self.session = requests.Session()
25
+ self.session.headers.update({"X-SQrypt-Key": api_key})
26
+
27
+ def encrypt(self, plaintext: Union[str, bytes]) -> SQryptPayload:
28
+ """Fetches a post-quantum data key and encrypts payload locally (Zero-Knowledge)."""
29
+ if not plaintext:
30
+ raise ValueError("Cannot encrypt an empty payload.")
31
+
32
+ raw_bytes = plaintext.encode('utf-8') if isinstance(plaintext, str) else plaintext
33
+
34
+ # 1. Fetch ephemeral keys from KMS backend
35
+ response = self.session.post(f"{self.server_url}/generate-data-key")
36
+ if response.status_code != 200:
37
+ raise RuntimeError(f"KMS Server Connection Error: {response.text}")
38
+
39
+ key_data = response.json()
40
+ plain_key = base64.b64decode(key_data["plaintext_data_key"])
41
+ pq_capsule = key_data["encrypted_data_key"]
42
+
43
+ # 2. Execute local AES-256-GCM encryption
44
+ try:
45
+ aesgcm = AESGCM(plain_key)
46
+ nonce = os.urandom(12)
47
+ ciphertext_bytes = aesgcm.encrypt(nonce, raw_bytes, None)
48
+
49
+ return SQryptPayload(
50
+ ciphertext=base64.b64encode(ciphertext_bytes).decode('utf-8'),
51
+ nonce=base64.b64encode(nonce).decode('utf-8'),
52
+ capsule=pq_capsule
53
+ )
54
+ finally:
55
+ # Secure memory cleanup: wipe the raw symmetric plaintext key reference
56
+ del plain_key
57
+
58
+ def decrypt(self, payload: Union[SQryptPayload, Dict[str, str]]) -> str:
59
+ """Asks KMS server to decapsulate the PQC key, then decrypts data locally."""
60
+ # Dynamically normalize input type if developer passed a dictionary
61
+ if isinstance(payload, dict):
62
+ payload = SQryptPayload(
63
+ ciphertext=payload["ciphertext"],
64
+ nonce=payload["nonce"],
65
+ capsule=payload["capsule"]
66
+ )
67
+
68
+ # 1. Send the ML-KEM capsule to server for decryption
69
+ response = self.session.post(
70
+ f"{self.server_url}/decrypt-data-key",
71
+ json={"encrypted_data_key": payload.capsule}
72
+ )
73
+ if response.status_code != 200:
74
+ raise RuntimeError(f"Decapsulation authorization failed: {response.text}")
75
+
76
+ unlocked_key = base64.b64decode(response.json()["plaintext_data_key"])
77
+
78
+ # 2. Locally decrypt the ciphertext bytes using recovered key
79
+ try:
80
+ aesgcm = AESGCM(unlocked_key)
81
+ ciphertext_bytes = base64.b64decode(payload.ciphertext)
82
+ nonce_bytes = base64.b64decode(payload.nonce)
83
+
84
+ decrypted_bytes = aesgcm.decrypt(nonce_bytes, ciphertext_bytes, None)
85
+ return decrypted_bytes.decode('utf-8')
86
+ except Exception as e:
87
+ raise ValueError("Decryption failed: Key mismatch or payload tampering detected.") from e
88
+ finally:
89
+ del unlocked_key
90
+
91
+ # ==========================================
92
+ # DYNAMIC INTERCEPTION INTERFACES
93
+ # ==========================================
94
+
95
+ def auto_encrypt(self) -> Callable:
96
+ """
97
+ Function decorator to intercept data during active processing pipelines.
98
+ Converts function outputs to an SQryptPayload dynamically.
99
+ """
100
+ def decorator(func: Callable) -> Callable:
101
+ @wraps(func)
102
+ def wrapper(*args, **kwargs):
103
+ raw_output = func(*args, **kwargs)
104
+ return self.encrypt(raw_output)
105
+ return wrapper
106
+ return decorator
107
+
108
+ def protect_dict(self, data: Dict, sensitive_keys: List[str]) -> Dict:
109
+ """
110
+ Scans unstructured models (JSON/DB targets) and replaces specified fields
111
+ with post-quantum protected dictionary schemas in-place.
112
+ """
113
+ protected_data = data.copy()
114
+ for key in sensitive_keys:
115
+ if key in protected_data and isinstance(protected_data[key], (str, bytes)):
116
+ payload = self.encrypt(protected_data[key])
117
+ protected_data[key] = payload.to_dict()
118
+ return protected_data
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: sqrypt-cyber-sdk
3
+ Version: 0.1.0
4
+ Summary: Enterprise Hybrid Post-Quantum Cryptography SDK wrapping NIST FIPS-203 (ML-KEM)
5
+ Author-email: Aryan Sujay <your.email@example.com>
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Classifier: Topic :: Security :: Cryptography
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: requests>=2.31.0
13
+
14
+ # SQrypt Post-Quantum Cybersecurity SDK 🛡️
15
+
16
+ SQrypt is an enterprise-grade developer kit designed to secure high-stakes data ingestion layers against future quantum threats. It provides an optimized, drop-in abstraction layer wrapping **NIST FIPS-203 (ML-KEM)** lattice cryptography.
17
+
18
+ ## Key Features
19
+ * **One-Line Implementation:** Secure runtime data routing via native Python decorators.
20
+ * **Hybrid Defense Architecture:** Merges classical AES-256-GCM symmetric block ciphers with post-quantum asymmetric encapsulation.
21
+ * **Zero-Knowledge Target Mutation:** Secure specific nested keys within complex JSON payloads without exposing metadata.
22
+
23
+ ## Installation
24
+ ```bash
25
+ pip install sqrypt-cyber-sdk
26
+ ```
27
+
28
+ ## Quick Start Guide
29
+ * **Initialize the Secure Client:** Connect the SDK to your isolated enterprise infrastructure instance by instantiating the client engine with your secret keys:
30
+ ```bash
31
+ from sqrypt import SQryptClient
32
+
33
+ client = SQryptClient(
34
+ server_url="[http://127.0.0.1:8500](http://127.0.0.1:8500)",
35
+ api_key="YOUR_ENTERPRISE_API_KEY"
36
+ )
37
+ ```
38
+
39
+ * **Runtime Interception (Pattern A):** Protect live string streams dynamically at the functional boundary using the automatic encryption decorator:
40
+ ```bash
41
+ @client.auto_encrypt()
42
+ def process_runtime_transaction(user_id: str, card_data: str) -> str:
43
+ # Data is automatically encapsulated before network dispatch
44
+ return f"USER:{user_id}|RAW_CARD:{card_data}"
45
+
46
+ # Executes lattice-based key encapsulation
47
+ protected_payload = process_runtime_transaction("usr_998", "4111-2222-3333-4444")
48
+
49
+ # Reclaim the plaintext string through zero-knowledge decapsulation
50
+ recovered_string = client.decrypt(protected_payload)
51
+ ```
52
+
53
+ * **Granular Field Masking (Pattern B):** To protect structural records or transactional documents before database insertion, mask target keys selectively:
54
+ ```bash
55
+ database_document = {
56
+ "account_id": "acc_001",
57
+ "status": "active",
58
+ "tax_id": "999-12-3456",
59
+ "secret_token": "token_xyz123"
60
+ }
61
+
62
+ # Mutates specified targets into quantum-secure ciphertext bundles
63
+ masked_document = client.protect_dict(
64
+ data=database_document,
65
+ sensitive_keys=["tax_id", "secret_token"]
66
+ )
67
+ ```
68
+
69
+ ## SECURITY SPECIFICATIONS
70
+ SQrypt's design parameters conform strictly to the modern cryptographic primitives evaluated by the National Institute of Standards and Technology (NIST):
71
+ | Layer / Algorithm / Standard | Target Bit Security | Notes / Details |
72
+ |-------------------------------------|------------------------------|-----------------------------------|
73
+ | Asymmetric Key Encapsulation | ML-KEM-768 (FIPS 203) | 192-bit (Quantum-Secure) |
74
+ | Symmetric Bulk Encryption | AES-256-GCM | 256-bit (Classical/Quantum-Safe) |
75
+ | Key Derivation Function | HKDF-SHA256 | High-Entropy Expansion |
76
+
77
+
78
+ ## License
79
+ This SDK is distributed under the terms of the MIT License.
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ sqrypt/__init__.py
4
+ sqrypt/client.py
5
+ sqrypt_cyber_sdk.egg-info/PKG-INFO
6
+ sqrypt_cyber_sdk.egg-info/SOURCES.txt
7
+ sqrypt_cyber_sdk.egg-info/dependency_links.txt
8
+ sqrypt_cyber_sdk.egg-info/requires.txt
9
+ sqrypt_cyber_sdk.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ requests>=2.31.0