mirror of
https://github.com/azaion/loader.git
synced 2026-04-22 10:16:32 +00:00
Quality cleanup refactoring
Made-with: Cursor
This commit is contained in:
@@ -15,7 +15,7 @@ All methods are `@staticmethod cdef` — Cython-only visibility, not callable fr
|
||||
| Method | Signature | Description |
|
||||
|-----------------------------|-----------------------------------------------------------------|----------------------------------------------------------------------|
|
||||
| `encrypt_to` | `(input_bytes, key) -> bytes` | AES-256-CBC encrypt with random IV, PKCS7 padding; returns `IV + ciphertext` |
|
||||
| `decrypt_to` | `(ciphertext_with_iv_bytes, key) -> bytes` | AES-256-CBC decrypt; first 16 bytes = IV; manual PKCS7 unpad |
|
||||
| `decrypt_to` | `(ciphertext_with_iv_bytes, key) -> bytes` | AES-256-CBC decrypt; first 16 bytes = IV; PKCS7 via `padding.PKCS7(128).unpadder()` |
|
||||
| `get_hw_hash` | `(str hardware) -> str` | Derives hardware hash: `SHA-384("Azaion_{hardware}_%$$$)0_")` → base64 |
|
||||
| `get_api_encryption_key` | `(Credentials creds, str hardware_hash) -> str` | Derives per-user+hw key: `SHA-384("{email}-{password}-{hw_hash}-#%@AzaionKey@%#---")` → base64 |
|
||||
| `get_resource_encryption_key`| `() -> str` | Returns fixed shared key: `SHA-384("-#%@AzaionKey@%#---234sdfklgvhjbnn")` → base64 |
|
||||
@@ -40,7 +40,7 @@ All methods are `@staticmethod cdef` — Cython-only visibility, not callable fr
|
||||
1. SHA-256 hash of string key → 32-byte AES key
|
||||
2. Split input: first 16 bytes = IV, rest = ciphertext
|
||||
3. AES-CBC decrypt
|
||||
4. Manual PKCS7 unpadding: read last byte as padding length; strip if 1–16
|
||||
4. PKCS7 removal via `cryptography` `padding.PKCS7(128).unpadder()` (`update` + `finalize`)
|
||||
|
||||
### Key Derivation Hierarchy
|
||||
- **Hardware hash**: salted hardware fingerprint → SHA-384 → base64
|
||||
|
||||
Reference in New Issue
Block a user