reconstruct_algorithm
Reconstruct standalone implementations of cryptographic algorithms from JavaScript source code and sample input/output pairs. Generate self-contained Python or Node.js code that reproduces the same transformation.
Instructions
Reconstruct a standalone implementation of a cryptographic algorithm from JS source + captured input/output samples. Given the original JS code and (optionally) sample input→output pairs, generate a self-contained Python implementation that reproduces the same transformation. Supports common AES/RSA/HMAC/MD5/SHA/SM2/SM3/SM4 patterns. Input: source code, optional samples (array of {input, output} pairs), target language (python/node). Returns reconstructed code + verification notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | JS source code containing the crypto function | |
| samples | No | Sample input/output pairs for verification | |
| functionName | No | Name of the target function to reconstruct (if known) | |
| targetLanguage | No | Output language (default: python) |