RSA Factoring Research RTL-CSP Cryptanalysis
GitHub
WHITE PAPER & OPEN-SOURCE PROOF OF CONCEPT

Cryptanalysis via Right-to-Left Base-10 Multiplication Reversal

An architectural constraint-satisfaction approach to integer factorization. Instead of algebraic division, this algorithm treats semiprime decomposition as a deterministic cascade—reconstructing prime factors digit-by-digit from the least significant column leftward using positional modulus pruning, terminal digit determinism, and square-root depth bounding.

Core Constraint
(A×B) mod 10ᵏ ≡ N mod 10ᵏ

Eliminates manual carry-over tracking via positional modular arithmetic.

Depth 0 Amputation
97% - 98% Cut

Terminal digit determinism reduces 100 initial pairs down to 2 or 3 valid seeds.

Square Root Bound
D_max = ⌊len(N)/2⌋

Locks DFS tree recursion depth to the geometric center around √N.

Legacy Benchmark
45,113 = 197 × 229

Evolved from a 20-year-old Java array prototype to C++ Boost BigInt DFS.

01 // RESEARCH GENESIS & MECHANICS

Running Long Multiplication in Reverse

The security of the RSA cryptosystem relies on the computational asymmetry of multiplying two large primes (p × q = N). While classical algorithms like the General Number Field Sieve (GNFS) treat N as a monolithic algebraic entity, this research approaches factorization from a low-level hardware mindset—treating multiplication as a deterministic cascade of single-digit operations.

Originally conceived over two decades ago in an experimental Java solver inspired by assembly-level shift-and-add Arithmetic Logic Units (ALUs), the early build stalled on the state-management complexity of rigid 3D arrays. By modernizing the architecture into an implicit 10-ary Depth-First Search (DFS) tree with arbitrary-precision integers, the call stack handles state rollback automatically.

How Positional Modulus Pruning Works

In base-10 arithmetic, any digit added at position k or higher is a multiple of 10ᵏ. Therefore, the rightmost k digits of a product depend exclusively on the rightmost k digits of its factors. If a partial candidate pair fails the local modulus check, no digits added to the left can ever repair it—allowing immediate branch pruning.

FIG 1.0 // EXECUTION FLOW DIAGRAM

Reverse Multiplication Tree: N = 45,113

Max Depth: 2
PHASE 1: TERMINAL DIGIT DETERMINISM (DEPTH 0 AMPUTATION) PHASE 2: TEN'S COLUMN BRANCHING & MODULUS PRUNING (DEPTH 1) PHASE 3: HUNDRED'S COLUMN & SQUARE ROOT BOUND (DEPTH 2) Target N = 45,113 N mod 10 = 3 (Length: 5) Seed Lookup (A ≤ B) 98/100 pairs skipped Seed 1: (1, 3) Seed 2: (7, 9) Candidate Branch: A = 17, B = 19 17 × 19 = 323 → 323 mod 100 = 23 Target 45113 mod 100 = 13 (23 ≠ 13) ✕ BRANCH PRUNED Candidate Branch: A = 97, B = 29 97 × 29 = 2,813 → 2813 mod 100 = 13 Target 45113 mod 100 = 13 (13 == 13) ✓ VALID MODULUS Depth 2 Match (a=1, b=2): A = 197, B = 229 197 × 229 = 45,113 == TARGET (Exact Prime Factors Resolved) Depth > ⌊5/2⌋ (2) triggers immediate bound cutoff on non-matching siblings
02 // INTERACTIVE SIMULATION

Live Right-to-Left Constraint Solver

Test the algorithm directly in your browser. Select a semiprime preset or enter a custom semiprime ending in 1, 3, 7, or 9 to observe how Terminal Digit Determinism, Positional Modulus Pruning, and the Square Root Bound collapse the search space.

Research Presets
Terminal Seeds (1, 3), (7, 9)
√N Max Depth 2 (Hundreds)
Branches Evaluated 0
Branches Pruned 0
Ready. Click "Factorize" to run DFS trace.
dfs_constraint_trace.log
IDLE
// Initialize solver to inspect right-to-left positional modulus pruning...
03 // OPTIMIZATION METRICS & CHARTS

Search Space Reduction & Complexity Analysis

While base-10 tree branching still scales exponentially at 2048-bit cryptographic scales, combining three structural constraints drastically collapses the search space compared to naive trial division and unpruned trees.

GRAPH 1 // ASYMPTOTIC SEARCH SPACE (LOG₁₀ SCALE)

Candidate Evaluations vs. Semiprime Digit Length

Comparing Naive Trial Division, Unpruned 10-ary Tree, and Optimized RTL-DFS.

GRAPH 2 // POSITIONAL MODULUS CULLING

Branch Survival Ratio per Column Depth

Percentage of theoretical 100-branch expansions surviving (A×B) mod 10ᵏ ≡ N mod 10ᵏ.

ADDENDUM A // O(1) DEPTH-0 BYPASS

Terminal Digit Determinism Matrix

A ≤ B Symmetry

Any prime factor greater than 5 must end in 1, 3, 7, or 9. Consequently, N mod 10 deterministically locks the one's place into just 2 or 3 seed pairs, amputating Depth 0 entirely.

Target N mod 10 Viable Seed Pairs (p₀, q₀) Search Reduction
Ends in 1 (1, 1), (3, 7), (9, 9) 97.0% pruned
Ends in 3 (1, 3), (7, 9) 98.0% pruned
Ends in 7 (1, 7), (3, 9) 98.0% pruned
Ends in 9 (1, 9), (3, 3), (7, 7) 97.0% pruned
GEOMETRIC CULLING // BRANCH & BOUND

The Square Root Bound (√N)

D_max = ⌊len(N)/2⌋

To prevent trivial trial division, RSA standards mandate that primes p and q share equal bit-lengths—clustering both factors tightly around √N. For a 5-digit target like 45,113 (√45113 ≈ 212.4), factors 197 and 229 sit directly on the median boundary.

PRUNED (Depth > D_max) √N SWEET SPOT 10⁰ (1) p=197 √N ≈ 212.4 q=229 N=45,113
OPEN-SOURCE REPOSITORY PLACEHOLDER

Explore the Full PoC Codebase on GitHub

Access the complete C++ arbitrary-precision constraint solver (Boost.Multiprecision), the legacy Java historical prototype, the white paper Markdown, and the multiprocessing semiprime dataset generator.

git clone https://github.com/jabrown2031/MONUMENTAL_FAULT.git
Open Repository ↗
// Compile: g++ -O3 factor.cpp -o factor (Requires libboost-all-dev)
#include <iostream>
#include <string>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using namespace boost::multiprecision;

const cpp_int TARGET("45113"); 
bool solution_found = false;

cpp_int pow10_big(int exp) {
    cpp_int res = 1;
    for (int i = 0; i < exp; ++i) res *= 10;
    return res;
}

// Recursive 10-ary DFS with Positional Modulus Pruning & Square Root Bound
void find_factors(int depth, cpp_int partial_A, cpp_int partial_B) {
    if (solution_found) return;

    if (partial_A * partial_B == TARGET && partial_A != 1 && partial_B != 1) {
        cout << "\n[+] Prime Factors Found: " << partial_A << " and " << partial_B << endl;
        solution_found = true;
        return;
    }

    // Square Root Bound: Lock depth to half the base-10 length of N
    int max_depth = TARGET.str().length() / 2; 
    if (depth > max_depth) return;

    cpp_int current_mod = pow10_big(depth + 1);
    cpp_int pos_mult = pow10_big(depth);

    for (int a = 0; a <= 9; ++a) {
        for (int b = 0; b <= 9; ++b) {
            cpp_int candidate_A = partial_A + (a * pos_mult);
            cpp_int candidate_B = partial_B + (b * pos_mult);

            // Modulus Pruning: Abandon branch immediately if rightmost k digits mismatch
            if ((candidate_A * candidate_B) % current_mod == TARGET % current_mod) {
                find_factors(depth + 1, candidate_A, candidate_B);
            }
        }
    }
}

int main() {
    int terminal_digit = (int)(TARGET % 10);
    vector<pair<int, int>> seed_pairs;

    // Terminal Digit Determinism: Amputate Depth 0 completely
    if (terminal_digit == 1) seed_pairs = {{1, 1}, {3, 7}, {9, 9}};
    else if (terminal_digit == 3) seed_pairs = {{1, 3}, {7, 9}};
    else if (terminal_digit == 7) seed_pairs = {{1, 7}, {3, 9}};
    else if (terminal_digit == 9) seed_pairs = {{1, 9}, {3, 3}, {7, 7}};

    for (auto& p : seed_pairs) {
        if (solution_found) break;
        find_factors(1, p.first, p.second); // Launch directly at ten's column
    }
    return 0;
}
04 // FUTURE WORK & EVOLUTION

Next-Generation Hybrid ML & Neuro-Symbolic Cryptanalysis

Pure neural networks fail at direct RSA factorization due to the avalanche effect of modular arithmetic—there is no smooth gradient when guessing a prime factor. However, pairing statistical machine learning with rigid mathematical verification unlocks powerful hybrid architectures.

PHASE 2A // NEURAL HEURISTICS PyTorch + PyBind11

ML-Guided DFS Branch Prediction

Instead of evaluating digit pairs (a, b) sequentially from 0 to 9, a lightweight Multi-Layer Perceptron (MLP) trained on digit frequency distributions scores candidate branches at each column depth. The C++ solver queries the model via PyBind11 to traverse highest-probability paths first while retaining exact modulus pruning.

AI Intuition (Probability Ranking) + C++ Modulo Math (100% Precision)
PHASE 2B // DATA ENGINEERING Parquet + Multi-Core CPU

Bounded Semiprime Training Corpora

Constructing multi-million sample datasets of balanced semiprimes tagged with their terminal digit seed classes and base-10 frequency vectors. Using native arbitrary-precision CPU multiprocessing avoids GPU PCIe serialization bottlenecks, exporting compressed .parquet files directly for GPU neural network training.

Input: [n_len, terminal_n, freq_0..9] → Target: Depth-k (p_k, q_k)
PHASE 3A // HARDWARE TOPOLOGY SIMT vs. Recursive Stack

Hybrid CPU-BFS / GPU-DFS Offloading

Asymmetrical backtracking causes severe warp divergence on SIMT GPU architectures, while dynamic BigInt allocations trigger VRAM register spilling. Future architecture experiments explore a hybrid pipeline: expanding a Breadth-First Search on host CPU cores to depth K, then dispatching fixed-width 64-bit limb registers across GPU wavefronts.

Host CPU BFS (Frontier Generation) → Device Fixed-Limb Register Sweep
PHASE 3B // AGENTIC RESEARCH Neuro-Symbolic Loop

Autonomous Verification & Lattice Bridging

Deploying multi-agent neuro-symbolic workflows pairing LLM hypothesis generation with Computer Algebra Systems (SageMath, PARI/GP, FLINT). Agents automatically benchmark positional modulus pruning against Coppersmith's lattice reduction and Fermat's method to evaluate asymptotic bounds (O-complexity) across bit-lengths.

Theorist Agent → C++/SageMath Harness → Skeptic Complexity Verifier