Impossible ElGamal signatures











up vote
0
down vote

favorite












From the following problem, I think it is not possible:



"
You find two signatures made by Alice. You know that she is
using the ElGamal signature scheme over $mathbb{F}_{2027}$. The cyclic group $mathbb{G}$ she is using is a
(multiplicative) subgroup of order 1013. The signatures are on hash values $h(m_1) =
345$
and $h(m_2) = 567$ and are given by $(r_1, s_1) = (365, 448)$ and $(r_2, s_2) = (365, 969)$.
Compute (a candidate for) Alice’s secret key $x$ based on these signatures, i.e. break
the system.
"



By the following equations, this is why I think these combinations are not possible:



$begin{cases} (365, 448) = (g^k mod 2027 , (345-365x)k^{-1} mod 2026) \
(365, 969) = (g^k mod 2027, (567-365x)k^{-1} mod 2026)
end{cases}$



The difference of the $y$-coordinate is $969-448 = 521mod 2026$ from the left side, and $(567-345)k^{-1}=222k^{-1} mod 2026$ from the right side. So the left side is odd and the right side is even while there are equal.



Do I do something wrong, or do you agree?










share|cite|improve this question






















  • even and odd are meaningless in modular arithmetic.
    – Henno Brandsma
    Nov 16 at 7:27










  • Why is that always meaningless?
    – Rocco van Vreumingen
    Nov 16 at 9:05










  • Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
    – Henno Brandsma
    Nov 16 at 9:05












  • Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
    – Rocco van Vreumingen
    Nov 16 at 9:08












  • If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
    – Henno Brandsma
    Nov 16 at 9:59

















up vote
0
down vote

favorite












From the following problem, I think it is not possible:



"
You find two signatures made by Alice. You know that she is
using the ElGamal signature scheme over $mathbb{F}_{2027}$. The cyclic group $mathbb{G}$ she is using is a
(multiplicative) subgroup of order 1013. The signatures are on hash values $h(m_1) =
345$
and $h(m_2) = 567$ and are given by $(r_1, s_1) = (365, 448)$ and $(r_2, s_2) = (365, 969)$.
Compute (a candidate for) Alice’s secret key $x$ based on these signatures, i.e. break
the system.
"



By the following equations, this is why I think these combinations are not possible:



$begin{cases} (365, 448) = (g^k mod 2027 , (345-365x)k^{-1} mod 2026) \
(365, 969) = (g^k mod 2027, (567-365x)k^{-1} mod 2026)
end{cases}$



The difference of the $y$-coordinate is $969-448 = 521mod 2026$ from the left side, and $(567-345)k^{-1}=222k^{-1} mod 2026$ from the right side. So the left side is odd and the right side is even while there are equal.



Do I do something wrong, or do you agree?










share|cite|improve this question






















  • even and odd are meaningless in modular arithmetic.
    – Henno Brandsma
    Nov 16 at 7:27










  • Why is that always meaningless?
    – Rocco van Vreumingen
    Nov 16 at 9:05










  • Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
    – Henno Brandsma
    Nov 16 at 9:05












  • Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
    – Rocco van Vreumingen
    Nov 16 at 9:08












  • If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
    – Henno Brandsma
    Nov 16 at 9:59















up vote
0
down vote

favorite









up vote
0
down vote

favorite











From the following problem, I think it is not possible:



"
You find two signatures made by Alice. You know that she is
using the ElGamal signature scheme over $mathbb{F}_{2027}$. The cyclic group $mathbb{G}$ she is using is a
(multiplicative) subgroup of order 1013. The signatures are on hash values $h(m_1) =
345$
and $h(m_2) = 567$ and are given by $(r_1, s_1) = (365, 448)$ and $(r_2, s_2) = (365, 969)$.
Compute (a candidate for) Alice’s secret key $x$ based on these signatures, i.e. break
the system.
"



By the following equations, this is why I think these combinations are not possible:



$begin{cases} (365, 448) = (g^k mod 2027 , (345-365x)k^{-1} mod 2026) \
(365, 969) = (g^k mod 2027, (567-365x)k^{-1} mod 2026)
end{cases}$



The difference of the $y$-coordinate is $969-448 = 521mod 2026$ from the left side, and $(567-345)k^{-1}=222k^{-1} mod 2026$ from the right side. So the left side is odd and the right side is even while there are equal.



Do I do something wrong, or do you agree?










share|cite|improve this question













From the following problem, I think it is not possible:



"
You find two signatures made by Alice. You know that she is
using the ElGamal signature scheme over $mathbb{F}_{2027}$. The cyclic group $mathbb{G}$ she is using is a
(multiplicative) subgroup of order 1013. The signatures are on hash values $h(m_1) =
345$
and $h(m_2) = 567$ and are given by $(r_1, s_1) = (365, 448)$ and $(r_2, s_2) = (365, 969)$.
Compute (a candidate for) Alice’s secret key $x$ based on these signatures, i.e. break
the system.
"



By the following equations, this is why I think these combinations are not possible:



$begin{cases} (365, 448) = (g^k mod 2027 , (345-365x)k^{-1} mod 2026) \
(365, 969) = (g^k mod 2027, (567-365x)k^{-1} mod 2026)
end{cases}$



The difference of the $y$-coordinate is $969-448 = 521mod 2026$ from the left side, and $(567-345)k^{-1}=222k^{-1} mod 2026$ from the right side. So the left side is odd and the right side is even while there are equal.



Do I do something wrong, or do you agree?







cryptography






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 15 at 15:46









Rocco van Vreumingen

478




478












  • even and odd are meaningless in modular arithmetic.
    – Henno Brandsma
    Nov 16 at 7:27










  • Why is that always meaningless?
    – Rocco van Vreumingen
    Nov 16 at 9:05










  • Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
    – Henno Brandsma
    Nov 16 at 9:05












  • Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
    – Rocco van Vreumingen
    Nov 16 at 9:08












  • If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
    – Henno Brandsma
    Nov 16 at 9:59




















  • even and odd are meaningless in modular arithmetic.
    – Henno Brandsma
    Nov 16 at 7:27










  • Why is that always meaningless?
    – Rocco van Vreumingen
    Nov 16 at 9:05










  • Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
    – Henno Brandsma
    Nov 16 at 9:05












  • Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
    – Rocco van Vreumingen
    Nov 16 at 9:08












  • If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
    – Henno Brandsma
    Nov 16 at 9:59


















even and odd are meaningless in modular arithmetic.
– Henno Brandsma
Nov 16 at 7:27




even and odd are meaningless in modular arithmetic.
– Henno Brandsma
Nov 16 at 7:27












Why is that always meaningless?
– Rocco van Vreumingen
Nov 16 at 9:05




Why is that always meaningless?
– Rocco van Vreumingen
Nov 16 at 9:05












Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
– Henno Brandsma
Nov 16 at 9:05






Not quite always, but e.g. modulo $9$ all $x$ are multiples of $2$. E.g. $7 = 2cdot 8$ in that ring.
– Henno Brandsma
Nov 16 at 9:05














Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
– Rocco van Vreumingen
Nov 16 at 9:08






Ok, but here we work with $mod (p-1)$ and $p-1$ is even. Hence $521 equiv 222k mod (p-1)$ is meaningless
– Rocco van Vreumingen
Nov 16 at 9:08














If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
– Henno Brandsma
Nov 16 at 9:59






If $k$ works so does $k+1013$, as we work in a smaller group than the full $Z^ast_p$. One $k$ can be even, the other odd.
– Henno Brandsma
Nov 16 at 9:59












1 Answer
1






active

oldest

votes

















up vote
1
down vote













The verifying equations are



$$H(m) = xr + ks bmod{(p-1)}tag{1}$$



and



$$H(m') = xr + ks' bmod{(p-1)}tag{2}$$



and as we have a common $k$ and $r$, there are two unknowns $x$ and $k$.



Solve these equations by standard techniques, $H(m), H(m')$ are known and find $x$ (and $k$ too, but that's not very useful).



I did and found an $x$ that works. If $k$ works so does $k+1012$ as $g$ has order $1012$, and so these give the same $r$.






share|cite|improve this answer























  • Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
    – Rocco van Vreumingen
    Nov 16 at 9:04










  • @RoccovanVreumingen I only computed the $x$ not the $k$.
    – Henno Brandsma
    Nov 16 at 9:09










  • $x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
    – Henno Brandsma
    Nov 16 at 9:10










  • It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
    – Rocco van Vreumingen
    Nov 16 at 9:26










  • @RoccovanVreumingen the $k$ is determined mod 1013 only.
    – Henno Brandsma
    Nov 16 at 9:29











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999857%2fimpossible-elgamal-signatures%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













The verifying equations are



$$H(m) = xr + ks bmod{(p-1)}tag{1}$$



and



$$H(m') = xr + ks' bmod{(p-1)}tag{2}$$



and as we have a common $k$ and $r$, there are two unknowns $x$ and $k$.



Solve these equations by standard techniques, $H(m), H(m')$ are known and find $x$ (and $k$ too, but that's not very useful).



I did and found an $x$ that works. If $k$ works so does $k+1012$ as $g$ has order $1012$, and so these give the same $r$.






share|cite|improve this answer























  • Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
    – Rocco van Vreumingen
    Nov 16 at 9:04










  • @RoccovanVreumingen I only computed the $x$ not the $k$.
    – Henno Brandsma
    Nov 16 at 9:09










  • $x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
    – Henno Brandsma
    Nov 16 at 9:10










  • It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
    – Rocco van Vreumingen
    Nov 16 at 9:26










  • @RoccovanVreumingen the $k$ is determined mod 1013 only.
    – Henno Brandsma
    Nov 16 at 9:29















up vote
1
down vote













The verifying equations are



$$H(m) = xr + ks bmod{(p-1)}tag{1}$$



and



$$H(m') = xr + ks' bmod{(p-1)}tag{2}$$



and as we have a common $k$ and $r$, there are two unknowns $x$ and $k$.



Solve these equations by standard techniques, $H(m), H(m')$ are known and find $x$ (and $k$ too, but that's not very useful).



I did and found an $x$ that works. If $k$ works so does $k+1012$ as $g$ has order $1012$, and so these give the same $r$.






share|cite|improve this answer























  • Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
    – Rocco van Vreumingen
    Nov 16 at 9:04










  • @RoccovanVreumingen I only computed the $x$ not the $k$.
    – Henno Brandsma
    Nov 16 at 9:09










  • $x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
    – Henno Brandsma
    Nov 16 at 9:10










  • It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
    – Rocco van Vreumingen
    Nov 16 at 9:26










  • @RoccovanVreumingen the $k$ is determined mod 1013 only.
    – Henno Brandsma
    Nov 16 at 9:29













up vote
1
down vote










up vote
1
down vote









The verifying equations are



$$H(m) = xr + ks bmod{(p-1)}tag{1}$$



and



$$H(m') = xr + ks' bmod{(p-1)}tag{2}$$



and as we have a common $k$ and $r$, there are two unknowns $x$ and $k$.



Solve these equations by standard techniques, $H(m), H(m')$ are known and find $x$ (and $k$ too, but that's not very useful).



I did and found an $x$ that works. If $k$ works so does $k+1012$ as $g$ has order $1012$, and so these give the same $r$.






share|cite|improve this answer














The verifying equations are



$$H(m) = xr + ks bmod{(p-1)}tag{1}$$



and



$$H(m') = xr + ks' bmod{(p-1)}tag{2}$$



and as we have a common $k$ and $r$, there are two unknowns $x$ and $k$.



Solve these equations by standard techniques, $H(m), H(m')$ are known and find $x$ (and $k$ too, but that's not very useful).



I did and found an $x$ that works. If $k$ works so does $k+1012$ as $g$ has order $1012$, and so these give the same $r$.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Nov 16 at 10:32

























answered Nov 16 at 7:31









Henno Brandsma

102k344108




102k344108












  • Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
    – Rocco van Vreumingen
    Nov 16 at 9:04










  • @RoccovanVreumingen I only computed the $x$ not the $k$.
    – Henno Brandsma
    Nov 16 at 9:09










  • $x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
    – Henno Brandsma
    Nov 16 at 9:10










  • It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
    – Rocco van Vreumingen
    Nov 16 at 9:26










  • @RoccovanVreumingen the $k$ is determined mod 1013 only.
    – Henno Brandsma
    Nov 16 at 9:29


















  • Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
    – Rocco van Vreumingen
    Nov 16 at 9:04










  • @RoccovanVreumingen I only computed the $x$ not the $k$.
    – Henno Brandsma
    Nov 16 at 9:09










  • $x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
    – Henno Brandsma
    Nov 16 at 9:10










  • It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
    – Rocco van Vreumingen
    Nov 16 at 9:26










  • @RoccovanVreumingen the $k$ is determined mod 1013 only.
    – Henno Brandsma
    Nov 16 at 9:29
















Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
– Rocco van Vreumingen
Nov 16 at 9:04




Yes, so $H(m) - H(m') equiv k(s-s')mod (p-1)$, but this yields $-521 equiv 222k mod (p-1)$, or equivalently $-521 - 222k equiv 0 mod (p-1)$. But since $-521-222k$ is odd and $p-1$ is even, is cannot be equal to a multiple of $p-1$. So it surprises me that you have found an $x$ and $k$.
– Rocco van Vreumingen
Nov 16 at 9:04












@RoccovanVreumingen I only computed the $x$ not the $k$.
– Henno Brandsma
Nov 16 at 9:09




@RoccovanVreumingen I only computed the $x$ not the $k$.
– Henno Brandsma
Nov 16 at 9:09












$x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
– Henno Brandsma
Nov 16 at 9:10




$x = r^{-1}(s-s')^{-1}(sH(m')-s'H(m))$ and this I could compute modulo $p-1$.
– Henno Brandsma
Nov 16 at 9:10












It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
– Rocco van Vreumingen
Nov 16 at 9:26




It is clear how you found an $x$, but I still don't see what was wrong in my calculation.
– Rocco van Vreumingen
Nov 16 at 9:26












@RoccovanVreumingen the $k$ is determined mod 1013 only.
– Henno Brandsma
Nov 16 at 9:29




@RoccovanVreumingen the $k$ is determined mod 1013 only.
– Henno Brandsma
Nov 16 at 9:29


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999857%2fimpossible-elgamal-signatures%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa