<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div>On 10 Nov 2017, at 03:17, Yawning Angel <<a href="mailto:yawning@schwanenlied.me">yawning@schwanenlied.me</a>> wrote:<br><br></div><blockquote type="cite"><div><span>On Thu, 9 Nov 2017 10:13:45 -0500</span><br><span>David Goulet <<span><a href="mailto:dgoulet@ev0ke.net">dgoulet@ev0ke.net</a></span>> wrote:</span><br><a href="#" class="_AppleShowQuotedContentButton"><div style="height: 80px !important; overflow: hidden !important;"><div preoffsettop="65" preoffsetheight="806"><blockquote type="cite" preoffsettop="65"><blockquote type="cite"><blockquote type="cite"><span>Ok fun! I'll add this. Good catch! And control-spec.txt should be</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="91"><blockquote type="cite"><blockquote type="cite"><span>updated.</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="117"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="143"><blockquote type="cite"><blockquote type="cite"><span>To be consistent then we could ask for a <Base64 Blob> as well:</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="169"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="195"><blockquote type="cite"><blockquote type="cite"><span>    "ED25519-V3:<Base64 Blob>"</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="221"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="247"><blockquote type="cite"><blockquote type="cite"><span>... which contains the ed25519 private key.  </span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="273"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="299"><blockquote type="cite"><span>If it were up to me, I'd spec the blob as opaque, and then actually</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="325"><blockquote type="cite"><span>use something that's sensible and consistent with the torrc and on</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="351"><blockquote type="cite"><span>disk files for easy interoperability like Base64 of the private key</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="377"><blockquote type="cite"><span>(I haven't check to see what encoding is used for on disk EdDSA</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="403"><blockquote type="cite"><span>keys, I assume PEM).  </span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="429"><span></span><br></blockquote><blockquote type="cite" preoffsettop="455"><span>Unfortunately not, it is custom to tor I believe with this 32 bytes</span><br></blockquote><blockquote type="cite" preoffsettop="481"><span>header:</span><br></blockquote><blockquote type="cite" preoffsettop="507"><span></span><br></blockquote><blockquote type="cite" preoffsettop="533"><span>    "== ed25519v1-secret: type0 ==\0\0\0"</span><br></blockquote><blockquote type="cite" preoffsettop="559"><span></span><br></blockquote><blockquote type="cite" preoffsettop="585"><span>... followed by the private key (64 bytes). See</span><br></blockquote><blockquote type="cite" preoffsettop="611"><span>crypto_write_tagged_contents_to_file().</span><br></blockquote><blockquote type="cite" preoffsettop="637"><span></span><br></blockquote><blockquote type="cite" preoffsettop="663"><span>Not sure we can change that within the 032 freeze. So the approach</span><br></blockquote><blockquote type="cite" preoffsettop="689"><span>would be to Base64 the raw bytes of the key (excluding the header).</span><br></blockquote><blockquote type="cite" preoffsettop="715"><span>Using tor HS key file, it would be something like:</span><br></blockquote><blockquote type="cite" preoffsettop="741"><span></span><br></blockquote><blockquote type="cite" preoffsettop="767"><span>    $ tail -c+33 hs_ed25519_secret_key | base64 -w 0</span><br></blockquote><blockquote type="cite" preoffsettop="793"><span></span><br></blockquote><blockquote type="cite" preoffsettop="819"><span>Considering the current situation with the encoded file on disk of</span><br></blockquote><blockquote type="cite" preoffsettop="845"><span>the key, I think this is kind of the simplest approach?</span><br></blockquote></div></div><div class="button">Show Quoted Content</div><div style="height: 80px !important; overflow: hidden !important;"><div preoffsettop="65" preoffsetheight="806"><blockquote type="cite" preoffsettop="65"><blockquote type="cite"><blockquote type="cite"><span>Ok fun! I'll add this. Good catch! And control-spec.txt should be</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="91"><blockquote type="cite"><blockquote type="cite"><span>updated.</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="117"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="143"><blockquote type="cite"><blockquote type="cite"><span>To be consistent then we could ask for a <Base64 Blob> as well:</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="169"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="195"><blockquote type="cite"><blockquote type="cite"><span>    "ED25519-V3:<Base64 Blob>"</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="221"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="247"><blockquote type="cite"><blockquote type="cite"><span>... which contains the ed25519 private key.  </span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="273"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="299"><blockquote type="cite"><span>If it were up to me, I'd spec the blob as opaque, and then actually</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="325"><blockquote type="cite"><span>use something that's sensible and consistent with the torrc and on</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="351"><blockquote type="cite"><span>disk files for easy interoperability like Base64 of the private key</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="377"><blockquote type="cite"><span>(I haven't check to see what encoding is used for on disk EdDSA</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="403"><blockquote type="cite"><span>keys, I assume PEM).  </span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="429"><span></span><br></blockquote><blockquote type="cite" preoffsettop="455"><span>Unfortunately not, it is custom to tor I believe with this 32 bytes</span><br></blockquote><blockquote type="cite" preoffsettop="481"><span>header:</span><br></blockquote><blockquote type="cite" preoffsettop="507"><span></span><br></blockquote><blockquote type="cite" preoffsettop="533"><span>    "== ed25519v1-secret: type0 ==\0\0\0"</span><br></blockquote><blockquote type="cite" preoffsettop="559"><span></span><br></blockquote><blockquote type="cite" preoffsettop="585"><span>... followed by the private key (64 bytes). See</span><br></blockquote><blockquote type="cite" preoffsettop="611"><span>crypto_write_tagged_contents_to_file().</span><br></blockquote><blockquote type="cite" preoffsettop="637"><span></span><br></blockquote><blockquote type="cite" preoffsettop="663"><span>Not sure we can change that within the 032 freeze. So the approach</span><br></blockquote><blockquote type="cite" preoffsettop="689"><span>would be to Base64 the raw bytes of the key (excluding the header).</span><br></blockquote><blockquote type="cite" preoffsettop="715"><span>Using tor HS key file, it would be something like:</span><br></blockquote><blockquote type="cite" preoffsettop="741"><span></span><br></blockquote><blockquote type="cite" preoffsettop="767"><span>    $ tail -c+33 hs_ed25519_secret_key | base64 -w 0</span><br></blockquote><blockquote type="cite" preoffsettop="793"><span></span><br></blockquote><blockquote type="cite" preoffsettop="819"><span>Considering the current situation with the encoded file on disk of</span><br></blockquote><blockquote type="cite" preoffsettop="845"><span>the key, I think this is kind of the simplest approach?</span><br></blockquote></div></div></a><div preoffsettop="65" preoffsetheight="806" style="display: none;"><blockquote type="cite" preoffsettop="65"><blockquote type="cite"><blockquote type="cite"><span>Ok fun! I'll add this. Good catch! And control-spec.txt should be</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="91"><blockquote type="cite"><blockquote type="cite"><span>updated.</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="117"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="143"><blockquote type="cite"><blockquote type="cite"><span>To be consistent then we could ask for a <Base64 Blob> as well:</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="169"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="195"><blockquote type="cite"><blockquote type="cite"><span>    "ED25519-V3:<Base64 Blob>"</span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="221"><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="247"><blockquote type="cite"><blockquote type="cite"><span>... which contains the ed25519 private key.  </span><br></blockquote></blockquote></blockquote><blockquote type="cite" preoffsettop="273"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="299"><blockquote type="cite"><span>If it were up to me, I'd spec the blob as opaque, and then actually</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="325"><blockquote type="cite"><span>use something that's sensible and consistent with the torrc and on</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="351"><blockquote type="cite"><span>disk files for easy interoperability like Base64 of the private key</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="377"><blockquote type="cite"><span>(I haven't check to see what encoding is used for on disk EdDSA</span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="403"><blockquote type="cite"><span>keys, I assume PEM).  </span><br></blockquote></blockquote><blockquote type="cite" preoffsettop="429"><span></span><br></blockquote><blockquote type="cite" preoffsettop="455"><span>Unfortunately not, it is custom to tor I believe with this 32 bytes</span><br></blockquote><blockquote type="cite" preoffsettop="481"><span>header:</span><br></blockquote><blockquote type="cite" preoffsettop="507"><span></span><br></blockquote><blockquote type="cite" preoffsettop="533"><span>    "== ed25519v1-secret: type0 ==\0\0\0"</span><br></blockquote><blockquote type="cite" preoffsettop="559"><span></span><br></blockquote><blockquote type="cite" preoffsettop="585"><span>... followed by the private key (64 bytes). See</span><br></blockquote><blockquote type="cite" preoffsettop="611"><span>crypto_write_tagged_contents_to_file().</span><br></blockquote><blockquote type="cite" preoffsettop="637"><span></span><br></blockquote><blockquote type="cite" preoffsettop="663"><span>Not sure we can change that within the 032 freeze. So the approach</span><br></blockquote><blockquote type="cite" preoffsettop="689"><span>would be to Base64 the raw bytes of the key (excluding the header).</span><br></blockquote><blockquote type="cite" preoffsettop="715"><span>Using tor HS key file, it would be something like:</span><br></blockquote><blockquote type="cite" preoffsettop="741"><span></span><br></blockquote><blockquote type="cite" preoffsettop="767"><span>    $ tail -c+33 hs_ed25519_secret_key | base64 -w 0</span><br></blockquote><blockquote type="cite" preoffsettop="793"><span></span><br></blockquote><blockquote type="cite" preoffsettop="819"><span>Considering the current situation with the encoded file on disk of</span><br></blockquote><blockquote type="cite" preoffsettop="845"><span>the key, I think this is kind of the simplest approach?</span><br></blockquote></div><span></span><br><span>Yeah.  Just the Base64ed private key (excluding that header and things)</span><br><span>seems reasonable.</span></div></blockquote><br><div>Do we accept base64 with padding? Without padding?</div><div>(We should accept both - we know how long the key is.)</div><div><br></div><div>Do we generate it with or without padding?</div><div>(We should follow whatever we do with RSA.)</div><div><br></div><div>T</div></body></html>