0
$\begingroup$

I'm trying to implement a Cramer Shoup cryptography system in C but I've run into problems with generating the keys.

From what I have found on the wiki and in other papers, to generate keys for Cramer Shoup you must generate a cyclic group G of order q with generators g1 and g2, then take 5 values between 0 and (q-1) and with that you can easily generate the keys.

I initially tried doing this manually, but I ran into issues that prevented me from going forward. I was told that some OpenSSL library should have a way to do this itself. After some digging I found that I could generate what I thought was a key using the command "openssl dhparam", but after toying with it it doesn't seem that it generates keys like I thought.

I am asking if you are aware of any code (Or commands) that could be used to help generate the keys of a cramer shoup cryptosystem. If you know of any code/commands/libraries that could help with this I greatly appreatiate it.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

I'm not familiar with the Cramer-Shoup cryptosystem, but it looks like you can obtain what's wanted by generating DSA parameters $P$, $Q$, $G$, yielding a Schnorr group of prime order $Q$ and generator $G$ under multiplication modulo $P$ ; then creating another generator as $G':=G^X\bmod P$ for a uniformly random (undisclosed) $X$ in $[2,Q-1]$.

With OpenSSL on the command line, the generation of $P$, $Q$, $G$ (with 3072-bit $P$ and 256-bit $Q$, which is believed safe for a decade at least, baring theoretical breakthrough or CRQC) goes:

openssl dsaparam -text 3072

For details on the math that's designed to apply, refer to FIPS 186-4 appendix B.1.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.