RSA_ddprx_search - Integer Factorization Tool
A parallel processing tool designed to find prime factors of integers using optimized algorithms.
Features
Multi-process parallel computation for faster factorization
Intelligent Monte Carlo-style search algorithm
Checkpoint capability to resume interrupted calculations
Auto-recovery from errors
Progress tracking and detailed logging
Support for various output formats
RSA_ddprx_search.PY (Size: 23.09 KB / Downloads: 3)
We construct a dataset by which a certain number of integers can be calculated to compute the greatest common divisor with an integer to be factorized. We also design a dynamic distributed parallel network to perform the search on the dataset. The network is grid alike, aopen to all the computers willing to take part in the computation.
We post our source codes here for interesters to vent.
Requirements
Install the optional dependency:
pip install gmpy2
Usage
Basic usage:
python RSA_ddprx_search.py -n 1438236853
Command Line Arguments
Argument Description Default
-n, --number Number to factorize 1438236853
-g, --step Densification repetition rate 30
-m, --processes Number of parallel processes CPU count
-c, --chunk-size Calculation chunk size 5,000,000
-o, --output Output filename rgTable.txt
--checkpoint Checkpoint filename checkpoint.json
--disable-checkpoint Disable checkpoint feature False
--resume Resume from last checkpoint False
--encoding File encoding utf-8
--no-pretty Disable pretty output formatting False
-v, --verbose Show verbose output False
--auto-continue Wait time in seconds before auto-continue on failure, 0 to disable None
Examples
Output Format
The tool generates a result file (default: rgTable.txt) containing
Troubleshooting
How It Works
The algorithm uses a distributed search method to find factors of integers:
Performance Tips
A parallel processing tool designed to find prime factors of integers using optimized algorithms.
Features
Multi-process parallel computation for faster factorization
Intelligent Monte Carlo-style search algorithm
Checkpoint capability to resume interrupted calculations
Auto-recovery from errors
Progress tracking and detailed logging
Support for various output formats
We construct a dataset by which a certain number of integers can be calculated to compute the greatest common divisor with an integer to be factorized. We also design a dynamic distributed parallel network to perform the search on the dataset. The network is grid alike, aopen to all the computers willing to take part in the computation.
We post our source codes here for interesters to vent.
Requirements
- Python 3.6+
- Optional: gmpy2 library for faster GCD calculations
Install the optional dependency:
pip install gmpy2
Usage
Basic usage:
python RSA_ddprx_search.py -n 1438236853
Command Line Arguments
Argument Description Default
-n, --number Number to factorize 1438236853
-g, --step Densification repetition rate 30
-m, --processes Number of parallel processes CPU count
-c, --chunk-size Calculation chunk size 5,000,000
-o, --output Output filename rgTable.txt
--checkpoint Checkpoint filename checkpoint.json
--disable-checkpoint Disable checkpoint feature False
--resume Resume from last checkpoint False
--encoding File encoding utf-8
--no-pretty Disable pretty output formatting False
-v, --verbose Show verbose output False
--auto-continue Wait time in seconds before auto-continue on failure, 0 to disable None
Examples
- Basic Factorization
python RSA_ddprx_search.py -n 2809686223 -g 20
- With More Processes
python RSA_ddprx_search.py -n 2809686223 -m 8
- Enabling Auto-Continue
python RSA_ddprx_search.py -n 2809686223 --auto-continue 30
- Resuming From Checkpoint
python RSA_ddprx_search.py --resume
Output Format
The tool generates a result file (default: rgTable.txt) containing
- Initial parameters
- Processing details for each CID (Computation ID)
- Any found factors
- Total runtime
Troubleshooting
- If you encounter memory errors, try reducing the -c (chunk size) parameter
- For performance issues, adjust the number of processes with -m
- If the program crashes, use the --resume option to continue from the last checkpoint
How It Works
The algorithm uses a distributed search method to find factors of integers:
- Divides the search space into multiple segments (ISZ blocks)
- Processes each segment in parallel
- Uses a Monte Carlo-style approach to efficiently explore the search space
- Applies GCD calculations to find common factors
Performance Tips
- The gmpy2 library significantly improves GCD calculation performance
- Adjust -g (densification repetition rate) parameter for balance between speed and thoroughness
- Set -m to match or slightly exceed your CPU core count
- For very large numbers, increase chunk size -c if memory allows