# Is it possible to create digital signature with specific p, q, e values by using OpenSSL?

I'm trying to create the digital signature by using these parameters and RSA algorithm:

• p = 645353605880701501120167331073
• q = 350784310265709643169455170929
• e = 19
• message = "G’day mate! As we are using a publicly available free WiFi network, our communication may be intercepted by cyber attackers. Therefore, we need to learn and apply cryptography techniques in our future communications."

I assume that I need to use OpenSSL to create the signature. However, I have no idea why the value of p, q, and e are given... If I use OpenSSL, maybe I don't need to use these values, and we can generate RSA public/private key automatically. Should I use OpenSSL to create a digital signature, or do I need to compute it manually? Are there any other tools that I could use to get the result?

Many thanks.

The public modulus $$n=pq$$ obtained from the question is 198-bit. That size is much too short to be secure.

Also it's too short for the most common standard RSA signature formats RSASSA-PKCS1-v1_5 and RSASSA-PSS, even with a 128-bit hash.

See Dave Thomson's comment for other padding formats that could still be usable.

• OpenSSL also supports X9.31 padding which can be as little as 2 bytes, and 'no' padding which if you allow (room for at least) one zero byte is effectively 'block type 0' from PKCS1-v1; these would allow a 160-bit hash, of which I believe RIPEMD160 is not broken. These paddings are no longer standard and not secure, but RSA-198 is already broken as you say so additional weakness doesn't really matter. Aug 17, 2022 at 2:02

I think you can do that in theory but I'm not sure of the actual specifics on how to do that. It's generally not advised to generate your own P & Q unless you have taken due care in generating them.