Score:1

Recovery of the Public Exponent in an RSA

us flag

I encrypted some data (an incredibly long time ago). I have both p,q,n,c, and a plaintext ciphertext pair (from when I encrypted the wrong data). I took to solving the discrete logarithms required here, and ended up with solutions to both of them using Baby Step Giant Step. I recovered e (e1) and tested using assert pow(message,e1,n) and got the ciphertext as a result, however it would seem that decryption of the message failed. In retrospect it is true I should have saved the decryption key $d$ and ended up not needing the data, but it would be great to know how this could have messed up. Could there have been multiple possible exponents from one p,q,e,ct,pt? How do I correctly recover the proper exponent e given e1,p,q,ct,pt?

fgrieu avatar
ng flag
Only in CTFs and exercises is RSA directly used to encrypt one's data. Thus this would be easier to sell as a tale: _once upon a time there was…_. The appropriate form on crypto-SE is to state it as: in textbook RSA, we get $p$, $q$, $n$, $m_1$, $c_1$ ,$c_2$ but not $e$ or $d$ or $m_2$. Using BSGS we found $e_1$ such that $c_1={m_1}^{e_1}\bmod n$. However when we compute a matching private exponent $d_1$ [e.g. per $d_1:={e_1}^{-1}\bmod((p-1)(q-1))$ ] then compute $m_2:={c_2}^{d_1}\bmod n$ we get an $m_2$ that's meaningless/does not pass padding check. What went wrong, and how do we fix this?
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.