Re: Question about the X25519 algo versus the
David Hook <dgh-rTAZ0PM/[email protected]> Thu, 3 Oct 2019 02:45:46 +1000
| Newsgroups | gmane.comp.encryption.bouncy-castle.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------CDF5A3039AF160A2F84528F3
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Answers in line.
Regards,
David
On 3/10/19 12:22 am, Benoit Laforest wrote:
>
> Hi,
>
> =C2=A0
>
> We are considering using the X25519 curve for the DH key exchange in
> our project, between our server and our clients and we have a few
> interrogation.
>
> =C2=A0
>
> * What is the difference between directly using the
> */X25519KeyPairGenerator/*and using =C2=A0a DH key generator via
> *GeneratorUtilities**.**GetKeyPairGenerator**(**=E2=80=9CECDH=E2=80=
=9D**)*?
>
Assuming it's returning a KeyPairGenerator use "XDH" rather than "ECDH".
The Edwards Curves keys in Java implement different interfaces from the
regular EC ones. Other than that I have no idea what GeneratorUtilities i=
s.
> *
>
>
> =C2=A0
>
> * Is using the *X22519* *key* pair generator meaning that we are
> using the same =E2=80=9Chardcoded=E2=80=9D curve on both server and=
clients?
>
Yes. It is kind of the idea though, so I wouldn't worry over that one.
>
> *
>
>
> =C2=A0
>
> * If we use the other option, with the *GeneratorUtilities*, then we
> would generate our *P and G parameters*, we would hardcode them
> and use them with the *DHKeyPairGenerator*but would this mean that
> we are using a another type of curve?
>
P and G makes it sound like you would be generating a regular
Diffie-Hellman key. That's a completely different algorithm.
>
> *
>
>
> =C2=A0
>
> Thanks for the help, I am pretty new to cryptography and I am still
> =E2=80=9Cdecrypting=E2=80=9D the concepts =F0=9F=98=8A
>
> =C2=A0
>
> Benoit
>
--------------CDF5A3039AF160A2F84528F3
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Answers in line.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Regards,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">David</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 3/10/19 12:22 am, Benoit Laforest
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CH2PR17MB351026B3DF63315704D26553E49C0-LTU+vRSwlTNOBMVBhzVmfn+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:527836370;
mso-list-type:hybrid;
mso-list-template-ids:-1508503674 1071407926 202113027 202113029 202113025 202113027 202113029 202113025 202113027 202113029;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-CA">We are considering using
the X25519 curve for the DH key exchange in our project,
between our server and our clients and we have a few
interrogation.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA">What is the difference between directly using
the
</span><b><i><span
style="font-size:9.5pt;font-family:Consolas;color:blue"
lang="EN-CA">X25519KeyPairGenerator</span></i></b><span
lang="EN-CA"> and using a DH key generator via
</span><b><span
style="font-size:9.5pt;font-family:Consolas;color:blue"
lang="EN-CA">GeneratorUtilities</span></b><b><span
style="font-size:9.5pt;font-family:Consolas;color:black"
lang="EN-CA">.</span></b><b><span
style="font-size:9.5pt;font-family:Consolas;color:#880000"
lang="EN-CA">GetKeyPairGenerator</span></b><b><span
style="font-size:9.5pt;font-family:Consolas;color:black"
lang="EN-CA">(</span></b><b><span
style="font-size:9.5pt;font-family:Consolas;color:navy"
lang="EN-CA">“ECDH”</span></b><b><span
style="font-size:9.5pt;font-family:Consolas;color:black"
lang="EN-CA">)</span></b><span lang="EN-CA">?</span></li>
</ul>
</div>
</blockquote>
<p>Assuming it's returning a KeyPairGenerator use "XDH" rather than
"ECDH". The Edwards Curves keys in Java implement different
interfaces from the regular EC ones. Other than that I have no
idea what GeneratorUtilities is.<br>
</p>
<blockquote type="cite"
cite="mid:CH2PR17MB351026B3DF63315704D26553E49C0-LTU+vRSwlTNOBMVBhzVmfn+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org">
<div class="WordSection1">
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA"><o:p></o:p></span><br>
</li>
</ul>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA">Is using the
<b>X22519</b> <b>key</b> pair generator meaning that we
are using the same “hardcoded” curve on both server and
clients?</span></li>
</ul>
</div>
</blockquote>
Yes. It is kind of the idea though, so I wouldn't worry over that
one.<br>
<blockquote type="cite"
cite="mid:CH2PR17MB351026B3DF63315704D26553E49C0-LTU+vRSwlTNOBMVBhzVmfn+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org">
<div class="WordSection1">
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA"><o:p></o:p></span><br>
</li>
</ul>
<p class="MsoListParagraph"><span lang="EN-CA"><o:p> </o:p></span></p>
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA">If we use the other option, with the
<b>GeneratorUtilities</b>, then we would generate our <b>P
and G parameters</b>, we would hardcode them and use
them with the
</span><b><span
style="font-size:9.5pt;font-family:Consolas;color:#2B91AF"
lang="EN-CA">DHKeyPairGenerator</span></b><span
lang="EN-CA"> but would this mean that we are using a
another type of curve?</span></li>
</ul>
</div>
</blockquote>
P and G makes it sound like you would be generating a regular
Diffie-Hellman key. That's a completely different algorithm.<br>
<blockquote type="cite"
cite="mid:CH2PR17MB351026B3DF63315704D26553E49C0-LTU+vRSwlTNOBMVBhzVmfn+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org">
<div class="WordSection1">
<ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph"
style="margin-left:0cm;mso-list:l0 level1 lfo1"><span
lang="EN-CA"><o:p></o:p></span><br>
</li>
</ul>
<p class="MsoListParagraph"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Thanks for the help, I
am pretty new to cryptography and I am still “decrypting”
the concepts
</span><span style="font-family:"Segoe UI
Emoji",sans-serif" lang="EN-CA">😊</span></p>
</div>
</blockquote>
<blockquote type="cite"
cite="mid:CH2PR17MB351026B3DF63315704D26553E49C0-LTU+vRSwlTNOBMVBhzVmfn+GY4YGzQ7gvxpqHgZTriW3zl9H0oFU5g@public.gmane.org">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-CA"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Benoit<o:p></o:p></span></p>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>
--------------CDF5A3039AF160A2F84528F3--