• Stars
    star
    261
  • Rank 156,630 (Top 4 %)
  • Language
    C
  • License
    GNU Lesser Genera...
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Factoring as a Service

FaaS

The purpose of the FaaS (Factoring as a Service) project is to demonstrate that 512-bit integers can be factored in only a few hours, for less than $100 of compute time in a public cloud environment. This illustrates the amazing progress in computing power over time, and the risk of continued use of 512-bit RSA keys.

Please do not use these scripts to attack any systems that you do not own.

Our scripts launch a compute cluster on Amazon EC2 and run the CADO-NFS and Msieve implementations of the number field sieve factoring algorithm, with some improvements to parallelization. For more information about the project, see our paper.

Quick Start Guide

This section shows you how to quickly get set up to factor.

Set up command machine (e.g., your workstation)

Set up and configure AWS CLI using these instructions. We recommend version 1.7.15 or higher. Make sure that your ~/.aws/config looks like

[default]
region = <EC2-region>
output = json

and your ~/.aws/credentials looks like

[default]
aws_access_key_id = <key_id>
aws_secret_access_key = <access_key>

Install Ansible using these instructions. Some older versions of Ansible do not work so we recommend version 1.9.2 or higher. Configure Boto (python interface to AWS) using these instructions. We recommend Boto version 2.38.0 or higher. Make sure your ~/.boto config looks like

[Credentials]
aws_access_key_id = <key_id>
aws_secret_access_key = <access_key>

Disable host key checking for Ansible hosts if you understand the security risks. Edit ~/.ansible.cfg to add the following lines:

[defaults]
host_key_checking = False

Install GNU Parallel using these instructions.

Go to the ec2 directory (some of our scripts use relative paths)

>$ cd ec2

Download Ansible EC2 dynamic inventory scripts

The scripts are available here, and you can download them with the following commands:

>$ wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/ec2.py
>$ chmod +x ec2.py
>$ wget https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/ec2.ini

Set the following values in ec2.ini.

regions = <EC2-region>  # you can leave this as 'all', but the script runs more quickly with a single region
cache_max_age = 0       # we want to always see the most up-to-date info about running instances, so do not cache
rds = False             # if your AWS user does not have rds permissions
elasticache = False     # if your AWS user does not have elasticache permissions

Configure AWS (Amazon Web Services) environment

The following script will create a new AWS VPC (Virtual Private Cloud) configured for FaaS.

>$ ./configure-aws.py

Set custom values for your setup in vars/custom.yml using your favorite text editor.

>$ vim vars/custom.yml

Build a base AMI

Use the following script to build a base AMI, which can take up to an hour to run. If the script fails halfway through (e.g., if you lose a connection to the instance), you can re-run it and it will skip any steps that have already been completed.

>$ ./build-base.sh

Optional: Run test factorization

To check that your AWS environment is correctly configured, we recommend that you run a small test factorization. Our test script will build a custom AMI for the test factorization, launch a cluster of four m4.large nodes, and factor a 100-digit number. The entire process should cost less than a dollar in EC2 credit, but will hopefully help you debug any issues with cluster setup. We recommend that you run the commands in the script one by one.

>$ ./test-factor.sh

Run factorization

The following script will build a new AMI, launch a cluster, and factor the 512-bit integer that you specified in vars/custom.yml. We recommend that you run the commands in the script one by one. After you've already built a custom AMI, it is no longer necessary to build a new AMI for each 512-bit factorization, so you may wish to comment out the first few lines. NOTE: You should not use the AMI built in test-factor.sh for 512-bit factorizations. Make sure that you terminate any instances with the tags 'faas_master', 'faas_slave', or 'faas_mpi' that might be left over from a previous run before running this script.

>$ ./factor.sh

Collect results

If all goes to plan, you will recieve an email with the results of the factorization. However, this is research code, and things do not always go as planned :). Some email providers may mark the result email as spam, and prevent its delivery.

By default, the master node will be stopped (not terminated) after the factorization has completed so that the relevant log files will not be deleted. This will continue to use resources on your Amazon account until the node is terminated.

The relevant log files are in the following locations on the master node:

/home/ubuntu/server.stderr          # the supervisor output file. You can watch the factorization live with 'tail -f server.stderr'.
/workdir/<job_name>/<job_name>.log  # the faas log file
/workdir/<job_name>/<job_name>.cmd  # the commands executed by the factoring script
/var/log/slurm/slurmctld.log        # the Slurm controller daemon log file

Good luck!

More Repositories

1

Reef

Reef: A zkSNARK system for proving that a committed document matches a regex
Rust
60
star
2

Beldi

Go
51
star
3

paella

Paella: Low-latency Model Serving with Virtualized GPU Scheduling
C++
39
star
4

flamingo

A secure aggregation system for private federated learning
Python
32
star
5

MimicNet

Predicting network performance at scale
C++
30
star
6

Flightplan

Flightplan is a toolchain for the flexible decomposition of P4 programs and their allocation to heterogeneous hardware to improve performance, reliability and utilisation of software-defined networks.
C
29
star
7

Mantis

Mantis: Reactive Programmable Switches (SIGCOMM 2020)
C++
22
star
8

Cebinae

Cebinae: Scalable In-network Fairness Augmentation (SIGCOMM 2022)
Python
21
star
9

incpir

Incremental Offline/Online PIR
C++
14
star
10

TELEPORT

Optimizing data-intensive systems in disaggregated data centers
C
13
star
11

Speedlight

Source code for Speedlight, a system for Synchronized Network Snapshots
P4
10
star
12

mu2sls

A framework for correctly implementing stateful microservice applications on serverless using standard Python.
Python
10
star
13

tpprof

Python
9
star
14

mucache

A caching framework for microservice applications
Go
9
star
15

Beaver

Beaver: Practical Partial Snapshots for Distributed Cloud Services (OSDI 2024)
C++
8
star
16

FDP

FDP is a portable demo/teaching platform for computer networking. It builds on existing tooling to enable end-to-end experimentation and zero-effort in-browser interactive visualization. It includes an example teaching demo and a demo for P4-based SDN research.
C#
8
star
17

otti

A zkSNARK compiler for optimization problems
Python
6
star
18

OrbWeaver

OrbWeaver: Using IDLE Cycles in Programmable Networks for Opportunistic Coordination (NSDI 2022)
Python
6
star
19

crypscan

A suite of tools for cryptographic analysis developed with system administrators in mind.
Shell
5
star
20

FP4

C++
4
star
21

IFS

Programmable switch with optional client privacy
C++
3
star
22

addax

C++
1
star