<div dir="ltr">Thank you Ivan, I've taken a look but as far as I understand your project only signs the HiddenService descriptors from an OpenPGP card. It still requires each backend instance to have its own copy of the key (where it can be read by an attacker). My goal is to have the HS private key exclusively inside the smartcard and only sign/decrypt with it when needed but never reveal it. An attacker should not be able to steal the key and host his own HS at the same address - the address would be effectively tied to the smartcard - whoever owns the smartcard can sign HS descriptors and decrypt traffic with it, so he or she is the owner of the service.<div><br></div><div>Best regards,</div><div>Razvan</div><div><br></div><div>--</div><div>Razvan Dragomirescu</div><div>Chief Technology Officer</div><div>Cayenne Graphics SRL</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 17, 2015 at 4:43 AM, Ivan Markin <span dir="ltr"><<a href="mailto:twim@riseup.net" target="_blank">twim@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
Razvan Dragomirescu:<br>
<span class="">> I am not sure if this has been discussed before or how hard it would be to<br>
> implement, but I'm looking for a way to integrate a smartcard with Tor -<br>
> essentially, I want to be able to host hidden service keys on the card. I'm<br>
> trying to bind the hidden service to a hardware component (the smartcard)<br>
> so that it can be securely hosted in a hostile environment as well as<br>
> impossible to clone/move without physical access to the smartcard.<br>
<br>
</span>I'm not sure that this solution is 100% for your purposes. But recently<br>
I've added OpenPGP smartcard support to do exactly this into OnionBlance<br>
[1]+[2]. What it does is that it just signs a HS descriptor using<br>
OpenPGP SC (via 'Signature' or 'Authentication' key). [It's still a<br>
pretty dirty hack, there is no even any exception handling.] You can use<br>
it by installing "manager/front" service with your smartcard in it via<br>
OnionBalace and balancing to your actual HS. There is no any bandwidth<br>
limiting (see OnionBalance design). You can setup OB and an actual HS on<br>
the same machine for sure.<br>
<span class=""><br>
> I have Tor running on the USBArmory by InversePath (<br>
> <a href="http://inversepath.com/usbarmory.html" rel="noreferrer" target="_blank">http://inversepath.com/usbarmory.html</a> ) and have a microSD form factor card<br>
> made by Swissbit (<br>
> <a href="http://www.swissbit.com/products/security-products/overwiev/security-products-overview/" rel="noreferrer" target="_blank">www.swissbit.com/products/security-products/overwiev/security-products-overview/</a><br>
> ) up and running on it. I am a JavaCard developer myself  and I have<br>
> developed embedded Linux firmwares before but I have never touched the Tor<br>
> source.<br>
<br>
</span>There is a nice JavaC applet by Joeri [3]. It's the same applet that<br>
Yubikey is using. You can find well-written tutorial of producing your<br>
OpenPGP card at Subgraph [4].<br>
<span class=""><br>
><br>
> Is there anyone that is willing to take on a side project doing this? Would<br>
> it be just a matter of configuring OpenSSL to use the card (I haven't tried<br>
> that yet)?<br>
<br>
</span>I'm not sure that it is worth to implement a card support in<br>
little-t-tor itself. As I said, all the logic is about HS descriptor<br>
signing. Python and other langs that provide readablity will provide<br>
security then.<br>
I think/hope so.<br>
<br>
[1] <a href="https://github.com/mark-in/onionbalance" rel="noreferrer" target="_blank">https://github.com/mark-in/onionbalance</a><br>
[2] <a href="https://github.com/mark-in/openpgpycard" rel="noreferrer" target="_blank">https://github.com/mark-in/openpgpycard</a><br>
[3] <a href="http://sourceforge.net/projects/javacardopenpgp/" rel="noreferrer" target="_blank">http://sourceforge.net/projects/javacardopenpgp/</a><br>
[4] <a href="https://subgraph.com/sgos/documentation/smartcards/index.en.html" rel="noreferrer" target="_blank">https://subgraph.com/sgos/documentation/smartcards/index.en.html</a><br>
<br>
Hope it helps.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Ivan Markin<br>
/"\<br>
\ /       ASCII Ribbon Campaign<br>
 X    against HTML email & Microsoft<br>
/ \  attachments! <a href="http://arc.pasp.de/" rel="noreferrer" target="_blank">http://arc.pasp.de/</a><br>
<br>
</font></span><br>_______________________________________________<br>
tor-dev mailing list<br>
<a href="mailto:tor-dev@lists.torproject.org">tor-dev@lists.torproject.org</a><br>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev" rel="noreferrer" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev</a><br>
<br></blockquote></div><br></div>