Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6891139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:22:19+00:00 2026-05-27T06:22:19+00:00

Lately I did a bit of research about the Digital Signature Algorithm and how

  • 0

Lately I did a bit of research about the Digital Signature Algorithm and how it works. My question according to this is of no practical matter for me but of pure interest.

However, I’m curious how to generate the subprime in DSA: Somewhere during the generation of the parameters for the algorithm one chooses a 1024-bit prime p. The next step is to find a 160-bit prime q which is a divisor of p-1. That’s where I get stuck. I have no idea how to find that subprime q in time, without having to wait forever. I also couldn’t find any documentation about that particular part of DSA on the internet and all the example implementations I’ve found use library functions to create the parameters.

Does anyone know more about that subprime generation or can lead me to a place where I can read about it?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:22:19+00:00Added an answer on May 27, 2026 at 6:22 am

    As suggested by Zoredache: The algorithm to create the pair of primes p and q for DSA, found in the Digital Signature Standard.

    Let L-1 = 160*n + b, where b,n ∈ ℕ and 0 ≤ b < 160

    1. Choose a random number seed > 2¹⁶⁰. Let g be the length of seed in bits.
    2. U = sha(seed) XOR sha(seed+1 mod 2^g) (where sha is the Secure Hash Algorithm)
    3. q = U OR 2¹⁵⁹ OR 1
    4. Test if q is prime, if not go to step 1.
    5. counter = 0, offset = 2
    6. For k = 0,...,n: V_k = sha((seed + offset + k) mod 2^g)
    7. W = V_0 + V_1 * 2^160 + ... + V_(n-1) * 2^((n-1)*160) + (V_n mod 2^b) * 2^(n*160)
    8. X = W + 2^(L-1)
    9. c = X mod 2*q
    10. p = X - (c-1)
    11. If p < 2^(L-1) go to step 13.
    12. Test if p is prime, if so go to step 15.
    13. counter = counter + 1, offset = offset + n + 1
    14. If counter >= 4096 go to step 1, if not go to step 7.
    15. We have now p and q so that q is a divisor of p-1.

    I hope I did not get anything wrong. I didn’t understand everything completely yet but the major trick is to calculate p out of q instead of trying the opposite thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been getting a lot of errors like this lately. I did some research and
I've read a lot lately about TDD, but I've only seen small examples. Now
Lately I've been thinking a lot about building a website/blog/community oriented site. However I
Lately I have become a huge fan of XSL, XPath and XML, but I've
The specs for my rails project have been really slow lately. I did a
Hey guys, lately I have been asking quite a few questions about memory management
I have been dealing with FTP lately and I'm not sure about the security
I've read numerous discussions lately about different forms of security for mobile devices outside
I've been thinking about storing C++ lambda's lately. The standard advice you see on
All, Wanted to get a few thoughts on this. Lately I am becoming more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.