Re: [viff-devel] Homomorphic encryption

2009-07-10 Thread Marc X. Makkes
Hi Claudio,

Yes, It takes 496 msec on my machine. For timing i used the following:

python -m timeit -s 'from pypaillier import generate_keys, encrypt' \
   -s 'pk, sk = generate_keys(2048)' \
   -s 'm = 98723498' \
   'encrypt(m, pk)'

python -m timeit -s 'from pypaillier import generate_keys, encrypt, decrypt' \
   -s 'pk, sk = generate_keys(2048)' \
   -s 'm = 98723498' \
   -s 'c = encrypt(m, pk)' \
   'decrypt(c, sk)'

Kind regards, 

-Marc



On Fri, Jul 10, 2009 at 03:04:44PM +0200, Claudio Orlandi wrote:
> Hi Marc,
> 
> Let me see if I understood the way you measured: it takes 496 msec on
> average to do an encryption with your code, right?
> 
> Claudio
> 
> On Fri, Jul 10, 2009 at 10:18 AM, Marc Makkes wrote:
> > Hi Janus,
> >
> > I think that I'd have reached the stage where you can test my code, but
> > still lacks some basic checks and is still prone to timing attacks and
> > is basically the same viffs current implementation, with some additional
> > speedups. So consequently, it code should only be used for testing purposes
> > only.
> >
> > I'm achieving the following speeds on my atom N270 ( 1.6Ghz ) testing
> > with key sizes of 2048 bit.
> >
> > Viff code:
> > --
> > Encrypting:
> > 10 loops, best of 3: 4.42 sec per loop
> > Decrypting:
> > 10 loops, best of 3: 925 msec per loop
> >
> > My code:
> > 
> > Encrypting:
> > 10 loops, best of 3: 496 msec per loop
> > Decrypting:
> > 10 loops, best of 3: 143 msec per loop
> >
> > For encrypting its almost a 9 fold speedup and for decrypting 6.5 times
> > with respect to the current implementation.
> >
> > In the tar ball you find the small makefile as well as a test.py file.
> > It shows the basic use of all functions. If you have any comments, issues
> > or questions please let me know.
> >
> > Happy testing,
> >
> > -Marc
> >
> > ___
> > viff-devel mailing list (http://viff.dk/)
> > viff-devel@viff.dk
> > http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk
> >
> >
> 
> 
> 
> -- 
> Claudio Orlandi
> 
> PhD student,
> Department of Computer Science, Turing-223
> Aarhus Universitet, Denmark
> http://www.daimi.au.dk/~orlandi

-- 
If this email is PGP signed, the fingerprint is: 
C6D2 B5D7 390E 0D4E DE02  460E DC7F 651E A9CB 1B34 
signed with a 521-bit ECC key 



pgpQsWCHtA4MH.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] [Marc Makkes] Homomorphic encryption

2009-06-18 Thread Marc X. Makkes
Hi Janus, 

On Thu, Jun 18, 2009 at 04:36:15PM +0200, Janus Dam Nielsen wrote:
>Great to hear from you, I will be your main contact, because I am
>probably the VIFF user who will be needing a fast homomorphic
>implementation the soonest.
>I guess that the actual scheme you are implementing is the Paillier
>encryption scheme?

Yes, i'm implementing the Paillier scheme. Currently i have C version of
VIFF python implementation and i'm busy doing the CRT and subgroup
version of the scheme. When i'm done its the base line for my
improvement version. That version should allready be a lot faster the
basic Python/C implementation. 
I'm expecting speed certainly in the computational direction, but in
the speedup in the algebraic setting is gonna be hard. 

>We generally use Paillier as a part of secure multiparty computation
>protocols, where each party has his own secret key and knows the public
>keys of the other players. The ciphertexts are generally multiplied a
>substantial number of times.

Can you give me the background of this application?


>We generally would like an implementation which is similar to the one
>already in VIFF in terms of API and functionality. I am not sure I
>understand what you mean by "missing a key setup/generation function",
>currently in Python there is a function which generates keys. If there
>are alternatives, then what are they and what would you suggest?

I don't think that is going to be a problem. The wish list that i'm
mentioning is for the C-api. So, please for get this. Also, i don't see any 
problems adapting for
python. Creating a python binding should easy to make. Do you have time
frame for when you are going to use the paillier implementation? Or is
it already running?

>Great, I hope it will outperform any other implementation ever made :)
>Having Python bindings for the c implementation is also of large value
>to us.

I'm pushing as hard as i can (-;

Kind regards, 

-Marc





-- 
If this email is PGP signed, the fingerprint is: 
C6D2 B5D7 390E 0D4E DE02  460E DC7F 651E A9CB 1B34 
signed with a 521-bit ECC key 



pgpvgJ0Ch2OEn.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk