Generate Large Prime Factors
Simple Linux commands to generate large prime factors
- Generate prime Candidates
ssh-keygen -G candidates -b 2048
- Creates a file called candidates in current directory
- Find prime from candidates
ssh-keygen -T moduli -f candidates
- Creates a file called moduli in current directory, taking input from the candidates file
- Pick two primes from moduli file
- Create a product
export BC_LINE_LENGTH=0
echo 'obase=16;ibase=16;<prime>*<prime>'|bc
- Optionally convert Hex to Decimal
echo 'obase=10; ibase=16; $hexNum' | bc
Other suggestions
- Generate multiple candidates/moduli files with different bit size and make prime factors out of them for security