Download ml-engine/models/tls_rendering_encoder.py from Amal340/phishing-framework-code: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/datasets/Amal340/phishing-framework-code/resolve/main/ml-engine/models/tls_rendering_encoder.py
- Command line
-
hf download hf://datasets/Amal340/phishing-framework-code/ml-engine/models/tls_rendering_encoder.py
-
curl -L -o tls_rendering_encoder.py https://huggingface.co/datasets/Amal340/phishing-framework-code/resolve/main/ml-engine/models/tls_rendering_encoder.py
729 Bytes
| """ | |
| Real-Time Rendering Signals and TLS Handshake Fingerprint Encoder | |
| (Dawson, Cartwright, & Whitfeild, 2026) | |
| Analyzes JA3/JA4 TLS handshake attributes, certificate chain anomalies, and dynamic DOM rendering telemetry. | |
| """ | |
| import numpy as np | |
| class TLSRenderingEncoder: | |
| def __init__(self, input_dim: int = 16, embed_dim: int = 16, seed: int = 202): | |
| rng = np.random.default_rng(seed) | |
| self.W = rng.normal(0, np.sqrt(2.0 / input_dim), size=(input_dim, embed_dim)) | |
| self.b = np.zeros(embed_dim) | |
| def forward(self, x_tls: np.ndarray) -> np.ndarray: | |
| z_tls = np.maximum(0.0, x_tls @ self.W + self.b) | |
| norm = np.linalg.norm(z_tls, axis=-1, keepdims=True) + 1e-8 | |
| return z_tls / norm | |