data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
897 stars 278 forks source link

Updated input during the runtime #1480

Open aaallami opened 3 weeks ago

aaallami commented 3 weeks ago

I am working on a project that involves reading and processing data from a file or network source. This data is constantly updated, typically every second. I am currently using Scapy's sniff function to capture packets. However, I am encountering an issue: the function captures packets only during the compilation phase, and it seems unable to capture updates during runtime. For example, I am using a for loop with a multithreading decorator to process packets:

@for_range_opt_multithread(n_threads,1000)
    def _(i):
        sniff(iface=interface, filter="tcp port 5000", prn=lambda x: print_packet_details(x), store=0, count=0)

This code processes 1000 packets, but it captures the packets only at the compilation time and not the run time. I would like to know if there is a way to enable MPSPDZ to continuously read from a file or network source, ensuring that it receives updated data in real-time. Thank you for your time and assistance.

mkskeller commented 1 week ago

You will need to use the client interface to do this. This involves compiled server-side code for secure computation and client-side code for the sniffing. See the following section for an example: https://mp-spdz.readthedocs.io/en/latest/io.html#python-trusted-client-tutorial