Generate Large Prime Factors

Simple Linux commands to generate large prime factors

  1. Generate prime Candidates
    • ssh-keygen -G candidates -b 2048
    • Note:
      • Use 1024 (or lesser) for faster and smaller prime number candidates generation, instead of 2048
      • 256 bit is considered uncrackable in 2023.
    • Creates a file called candidates in current directory
  2. Find prime from candidates
    • ssh-keygen -T moduli -f candidates
    • Creates a file called moduli in current directory, taking input from the candidates file
  3. Pick two primes from moduli file - this is last column in each row (the longest number)
    1. Refer to man moduli for details on other columns
    2. Set two variables with primes, PRIME1 and PRIME2 for next step to create a PRODUCT
  4. Create a product
    • export BC_LINE_LENGTH=0
    • echo "obase=16;ibase=16;$PRIME1*$PRIME2"|bc

      OR

    • PRODUCT=$(echo "obase=16;ibase=16;$PRIME1*$PRIME2"|bc)
  5. Optionally convert Hex to Decimal
    1. echo "obase=10; ibase=16; $PRODUCT" | bc

Other suggestions

  • Generate multiple candidates/moduli files with different bit size and make prime factors out of them for security

Example Primes

Output of moduli file, candidates generated with 512 bits. Last long column is prime in hex.

20231229143039 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC3F850A7
20231229143039 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC3FA65B7
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC3FDC6CB
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC3FE2B63
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC3FFCE13
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4081F83
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4095087
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4104E73
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC413848B
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4165713
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4198B63
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC419B21B
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC41A265B
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC41C8FE3
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC41F125B
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC423E95B
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC424C7C7
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4250EA7
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC42583D7
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC425F2D7
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC427D493
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC42C1CFB
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC42E4E73
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC435B943
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC437BD37
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC438673B
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC43A07B7
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC43D8D2B
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC44C1EBB
20231229143040 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC455752B
20231229143040 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC456A197
20231229143041 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC45BA2AF
20231229143041 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC46755AB
20231229143041 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC468E1AB
20231229143041 2 6 100 511 2 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC468FB2B
20231229143041 2 6 100 511 5 F32AF1CDB1EE0CCBAFEC309C4861D9EFA7EF464F76F53338C1980C99E8777C4FB844031A54F85BA01527773BDFD52872468F17250C2F7383988794DAC4727877

Another set

20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E27FF388A3
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E27FF75F5F
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E27FFB6EAF
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E27FFE5973
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2800055E7
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28002FE63
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28006DAE3
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2800894AF
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2800C61AB
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28012DFC3
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E280181AD7
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2801AA5FB
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2801F48F3
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28020095F
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28022C2BB
20231229145001 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28024B8FF
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28027EC83
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2802C6AEB
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2802D1D53
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2802FC233
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E280306BFB
20231229145001 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2803252EB
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28033E41F
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28034207F
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28037C63F
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E280410D67
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E280413B03
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28041FBFF
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E280437EB7
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28044C137
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28045F2FB
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2804777AB
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28047D74B
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2804AAF1F
20231229145002 2 6 100 511 5 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2804C7BCF
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E28058C73B
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2805AD5A3
20231229145002 2 6 100 511 2 D6D2B689F1F16684A8EECF2A5266D18A744EFD5ADF666E37BE830FCAA39A83A0B963BB999997644688C86F06372E4B3801B6C7F7FD345BD3F0EF16E2806B31D3

QR Code
QR Code tech:generate_prime_factors (generated for current page)