Score:0

Issues generating keys/cyclic group for Cramer-Shoup Cryptosystem with OpenSSL

ru flag

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.

Score:1
ng flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.