Discussion:
VIFF needs at least 3 players always?
Kyung-Wook Hwang
2010-10-07 14:43:52 UTC
Permalink
Hello,

This is Kyung Hwang from Columbia University again. I have another question.

Does Viff always need at least 3 participants? It seems to me it does.

I modified "beginner.py" for two players because that file was
simplest to modify, but when I ran the two players, I got the
following errors:

***@kwhwang-sim1:~/viff-1.0/apps$ python beginner2.py player-2.ini
20 --no-ssl
Seeding random generator with random seed 3781
/home/kwhwang/opt/lib/python/viff/prss.py:43: DeprecationWarning: the
sha module is deprecated; use the hashlib module instead
import sha
I am player 2 and will input 20
Not using SSL
Listening on port 9002
#### Starting reactor ###
----------------------------------------------------------------
Program started

Error: [Failure instance: Traceback: <type 'exceptions.KeyError'>: 3
/home/kwhwang/opt/lib/python/viff/runtime.py:317:stringReceived
/home/kwhwang/opt/lib/python/viff/runtime.py:456:identify_peer
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:280:callback
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:354:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:371:_runCallbacks
beginner2.py:69:protocol
/home/kwhwang/opt/lib/python/viff/passive.py:493:input
/home/kwhwang/opt/lib/python/viff/passive.py:550:shamir_share
/home/kwhwang/opt/lib/python/viff/runtime.py:785:_expect_share
/home/kwhwang/opt/lib/python/viff/runtime.py:749:_expect_data
/home/kwhwang/opt/lib/python/viff/runtime.py:754:_expect_data_with_pc


I also modified equality.py for two players to see if it works for
only two players because that file actually compared only two players'
inputs but not the third player's so that file essentially needs two
players. But it gaves errors too with two players.

I think Viff only works with at least three players. Am I correct?

Thank you.

Kyung
Mikkel Krøigård
2010-10-07 14:57:56 UTC
Permalink
Post by Kyung-Wook Hwang
Hello,
This is Kyung Hwang from Columbia University again. I have another question.
Does Viff always need at least 3 participants? It seems to me it does.
That depends on the runtime you use. If you are using the default
passive security runtime, this is based on Shamir secret-sharing.
Therefore there must be at least 3 parties, and the threshold will
always be < n/2.

There is in fact also a two-party runtime based on the Paillier
cryptosystem. You can check it out if you want, it's in paillier.py.

But basically you have to select a runtime that gives you what you
want. If you want 2-party MPC, you can't use the Shamir sharing based
runtime.
Post by Kyung-Wook Hwang
I modified "beginner.py" for two players because that file was
simplest to modify, but when I ran the two players, I got the
20 --no-ssl
Seeding random generator with random seed 3781
/home/kwhwang/opt/lib/python/viff/prss.py:43: DeprecationWarning: the
sha module is deprecated; use the hashlib module instead
import sha
I am player 2 and will input 20
Not using SSL
Listening on port 9002
#### Starting reactor ###
----------------------------------------------------------------
Program started
Error: [Failure instance: Traceback: <type 'exceptions.KeyError'>: 3
/home/kwhwang/opt/lib/python/viff/runtime.py:317:stringReceived
/home/kwhwang/opt/lib/python/viff/runtime.py:456:identify_peer
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:280:callback
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:354:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:371:_runCallbacks
beginner2.py:69:protocol
/home/kwhwang/opt/lib/python/viff/passive.py:493:input
/home/kwhwang/opt/lib/python/viff/passive.py:550:shamir_share
/home/kwhwang/opt/lib/python/viff/runtime.py:785:_expect_share
/home/kwhwang/opt/lib/python/viff/runtime.py:749:_expect_data
/home/kwhwang/opt/lib/python/viff/runtime.py:754:_expect_data_with_pc
As you can see, it's using shamir_share. Shamir sharing requires at
least 3 players.
Post by Kyung-Wook Hwang
I also modified equality.py for two players to see if it works for
only two players because that file actually compared only two players'
inputs but not the third player's so that file essentially needs two
players. But it gaves errors too with two players.
I think Viff only works with at least three players. Am I correct?
Same as above :)

Regards,
Mikkel Krøigård
Claudio Orlandi
2010-10-07 15:00:33 UTC
Permalink
There is also an Orlandi runtime and a BeDOZa runtime (under
development). They work for 2 parties and guarantee security against
active adversaries (paillier.py is only for passive security).

Claudio
Post by Kyung-Wook Hwang
Hello,
This is Kyung Hwang from Columbia University again. I have another question.
Does Viff always need at least 3 participants? It seems to me it does.
That depends on the runtime you use. If you are using the default passive
security runtime, this is based on Shamir secret-sharing. Therefore there
must be at least 3 parties, and the threshold will always be < n/2.
There is in fact also a two-party runtime based on the Paillier
cryptosystem. You can check it out if you want, it's in paillier.py.
But basically you have to select a runtime that gives you what you want. If
you want 2-party MPC, you can't use the Shamir sharing based runtime.
Post by Kyung-Wook Hwang
I modified "beginner.py" for two players because that file was
simplest to modify, but when I ran the two players, I got the
20 --no-ssl
Seeding random generator with random seed 3781
/home/kwhwang/opt/lib/python/viff/prss.py:43: DeprecationWarning: the
sha module is deprecated; use the hashlib module instead
 import sha
I am player 2 and will input 20
Not using SSL
Listening on port 9002
#### Starting reactor ###
----------------------------------------------------------------
Program started
Error: [Failure instance: Traceback: <type 'exceptions.KeyError'>: 3
/home/kwhwang/opt/lib/python/viff/runtime.py:317:stringReceived
/home/kwhwang/opt/lib/python/viff/runtime.py:456:identify_peer
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:280:callback
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:354:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:371:_runCallbacks
beginner2.py:69:protocol
/home/kwhwang/opt/lib/python/viff/passive.py:493:input
/home/kwhwang/opt/lib/python/viff/passive.py:550:shamir_share
/home/kwhwang/opt/lib/python/viff/runtime.py:785:_expect_share
/home/kwhwang/opt/lib/python/viff/runtime.py:749:_expect_data
/home/kwhwang/opt/lib/python/viff/runtime.py:754:_expect_data_with_pc
As you can see, it's using shamir_share. Shamir sharing requires at least 3
players.
Post by Kyung-Wook Hwang
I also modified equality.py for two players to see if it works for
only two players because that file actually compared only two players'
inputs but not the third player's so that file essentially needs two
players. But it gaves errors too with two players.
I think Viff only works with at least three players. Am I correct?
Same as above :)
Regards,
Mikkel Krøigård
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Thomas P Jakobsen
2010-10-08 08:39:14 UTC
Permalink
Post by Claudio Orlandi
There is also an Orlandi runtime and a BeDOZa runtime (under
development). They work for 2 parties and guarantee security against
active adversaries (paillier.py is only for passive security).
Claudio
The current implementation of the Orlandi runtime found in orlandi.py
unfortunately depends on a 3rd party party package for elliptic curve
cryptography that is not open source. So unless you have a special
agreement with the owners of that package
(http://www.cryptomathic.com) or can find something similar, you won't
be able to use it.

The BeDOZa runtime is completely open-source, but as Claudio mentions,
it is not fully implemented yet.

So for now, the only 2-party runtime is the passively secure paillier
runtime in paillier.py.

Regards,
Thomas
Kyung-Wook Hwang
2010-10-13 22:27:32 UTC
Permalink
Post by Thomas P Jakobsen
The current implementation of the Orlandi runtime found in orlandi.py
unfortunately depends on a 3rd party party package for elliptic curve
cryptography that is not open source. So unless you have a special
agreement with the owners of that package
(http://www.cryptomathic.com) or can find something similar, you won't
be able to use it.
The BeDOZa runtime is completely open-source, but as Claudio mentions,
it is not fully implemented yet.
So for now, the only 2-party runtime is the passively secure paillier
runtime in paillier.py.
Regards,
Thomas
Thanks a lot for all the comments.

Now I use PaillierRuntime for 2 player computation. Since I also need to do
comparison computation, I added ComparisonToft05Mixin for my runtime, too.

However, when I run my program, it gets stuck in the comparison part in my code
and does not proceed any further.

Can PaillierRuntime and ComparisonToft05Mixin not be used together?

I used runtime.share instead of runtime.shamir_share and did not really change
the rest. Am I missing anything here? (My original comparison program worked
well with 3 players without using PaillierRuntime.)

Thank you very much.

Kyung
Mikkel Krøigård
2010-10-22 13:30:05 UTC
Permalink
Post by Kyung-Wook Hwang
Thanks a lot for all the comments.
Now I use PaillierRuntime for 2 player computation. Since I also need to do
comparison computation, I added ComparisonToft05Mixin for my runtime, too.
ComparisonToft05Mixin and the rest of the code in comparison.py
depends on the default (Shamir based) runtimes (active and passive).
So you can't use this with the Paillier based runtime.
Post by Kyung-Wook Hwang
However, when I run my program, it gets stuck in the comparison part in my code
and does not proceed any further.
Yes this is somewhat unfortunate. Errors are not reported and the
program appears to be stuck. We discussed this recently and apparently
there isn't an easy and a good fix.

But anyway, the reason is that the two parts cannot be used together.
Post by Kyung-Wook Hwang
Can PaillierRuntime and ComparisonToft05Mixin not be used together?
Nope. I've never looked much at the two-party stuff myself, but I
believe (and someone can jump in and correct me if I'm wrong) that
there isn't any comparison code for this (yet).

This should of course be doable because paillier.py is able to
evaluate arithmetic circuits.

VIFF was at first really only intended to cover the Shamir sharing
approach, so that is why comparison.py might look like it should work
in general but only works for Shamir sharing.
Post by Kyung-Wook Hwang
I used runtime.share instead of runtime.shamir_share and did not really change
the rest. Am I missing anything here? (My original comparison program worked
well with 3 players without using PaillierRuntime.)
Thank you very much.
Kyung
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Kyung-Wook Hwang
2010-10-22 15:49:25 UTC
Permalink
Thank you very much for all the kind replies. They helped a lot.

Best,
Kyung
Post by Kyung-Wook Hwang
Thanks a lot for all the comments.
Now I use PaillierRuntime for 2 player computation. Since I also need to do
comparison computation, I added ComparisonToft05Mixin for my runtime, too.
ComparisonToft05Mixin and the rest of the code in comparison.py depends on
the default (Shamir based) runtimes (active and passive). So you can't use
this with the Paillier based runtime.
Post by Kyung-Wook Hwang
However, when I run my program, it gets stuck in the comparison part in my code
and does not proceed any further.
Yes this is somewhat unfortunate. Errors are not reported and the program
appears to be stuck. We discussed this recently and apparently there isn't
an easy and a good fix.
But anyway, the reason is that the two parts cannot be used together.
Post by Kyung-Wook Hwang
Can PaillierRuntime and ComparisonToft05Mixin not be used together?
Nope. I've never looked much at the two-party stuff myself, but I believe
(and someone can jump in and correct me if I'm wrong) that there isn't any
comparison code for this (yet).
This should of course be doable because paillier.py is able to evaluate
arithmetic circuits.
VIFF was at first really only intended to cover the Shamir sharing approach,
so that is why comparison.py might look like it should work in general but
only works for Shamir sharing.
Post by Kyung-Wook Hwang
I used runtime.share instead of runtime.shamir_share and did not really change
the rest. Am I missing anything here? (My original comparison program worked
well with 3 players without using PaillierRuntime.)
Thank you very much.
Kyung
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
_______________________________________________
viff-devel mailing list (http://viff.dk/)
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Marcel Keller
2010-11-02 12:59:44 UTC
Permalink
Hi Kyung,

Does the problem still occur? As mentioned earlier, it can happen that
VIFF hangs without error message if there are problems. This is due to
the internal structure of the underlying Twisted framework. I see two
possibilities of further debugging:

- Use the --deferred-debug option. This might give useful error
messages. Try to kill python if not.
- Use the experimental C optimized VIFF available on hg.viff.dk/mkeller
(you have to compile it using setup.py). This one directly crashes in
case of an error.

Best regards,
Marcel
Hi Marcel,
I tested millionaires.py with three different machines that have all
same version of pythone (2.6.5), but the result was just the same as
before.(the process is stuck in the middle in every terminal)
Thanks,
Kyung
On Wed, Oct 13, 2010 at 2:19 PM, Kyung-Wook Hwang
Hi Marcel,
Thanks a lot for your immediate response, and I totally did not know
that my question was discussed on the mailing list. I got bunch of
good comments. Thanks again!
Regarding the previous issue, as you pointed out, one machine has a
different version of Python. I will let you know after I test it again
with all the same version.
Thanks,
Kyung
Hi Kyung,
your question was actually discussed on the mailing list, but without
sending the answers to you. See
http://news.gmane.org/gmane.comp.cryptography.viff.devel
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
Concerning your problem running VIFF on different hosts: The
DeprecationWarning is shown by Python version 2.5 or higher, but there
should not be a problem because of that. The fact that the host of player 1
does not show the warning indicates that you use different versions of
Python. If that is true, you should try to use the same version on every
host.
Best regards,
Marcel
Hi Marcel,
I have got another question and I am sorry that I directly email you,
not though viff-devel. I emailed viff-devel but haven't received a
reply yet.
Does Viff work with only two players? I do not think it does,
according to my test. I think it needs at least 3 players.
Am I correct?
Thank you very much.
Kyung
---------- Forwarded message ----------
Date: Thu, Oct 7, 2010 at 10:43 AM
Subject: VIFF needs at least 3 players always?
Hello,
This is Kyung Hwang from Columbia University again. I have another question.
Does Viff always need at least 3 participants? It seems to me it does.
I modified "beginner.py" for two players because that file was
simplest to modify, but when I ran the two players, I got the
20 --no-ssl
Seeding random generator with random seed 3781
/home/kwhwang/opt/lib/python/viff/prss.py:43: DeprecationWarning: the
sha module is deprecated; use the hashlib module instead
import sha
I am player 2 and will input 20
Not using SSL
Listening on port 9002
#### Starting reactor ###
----------------------------------------------------------------
Program started
Error: [Failure instance: Traceback:<type 'exceptions.KeyError'>: 3
/home/kwhwang/opt/lib/python/viff/runtime.py:317:stringReceived
/home/kwhwang/opt/lib/python/viff/runtime.py:456:identify_peer
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:280:callback
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:354:_startRunCallbacks
---<exception caught here> ---
/usr/lib/python2.6/dist-packages/twisted/internet/defer.py:371:_runCallbacks
beginner2.py:69:protocol
/home/kwhwang/opt/lib/python/viff/passive.py:493:input
/home/kwhwang/opt/lib/python/viff/passive.py:550:shamir_share
/home/kwhwang/opt/lib/python/viff/runtime.py:785:_expect_share
/home/kwhwang/opt/lib/python/viff/runtime.py:749:_expect_data
/home/kwhwang/opt/lib/python/viff/runtime.py:754:_expect_data_with_pc
I also modified equality.py for two players to see if it works for
only two players because that file actually compared only two players'
inputs but not the third player's so that file essentially needs two
players. But it gaves errors too with two players.
I think Viff only works with at least three players. Am I correct?
Thank you.
Kyung
Loading...