Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit 28e7e42

Browse files
committed
Docker working
1 parent e4da3f0 commit 28e7e42

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ services:
33
- docker
44
install:
55
- docker build .
6-
#after_script:
7-
# - "curl -X POST https://hooks.microbadger.com/images/qmcgaw/"
6+
after_script:
7+
- "curl -X POST https://hooks.microbadger.com/images/qmcgaw/homomorphic-binary-circuits/5_ZQZ6uhRXvjJSJ9A6pWjfh0x2M="

Dockerfile

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM debian:stretch-slim
22
LABEL maintainer="[email protected]" \
3-
description="" \
4-
download="MB" \
5-
size="MB" \
3+
description="Homomorphic binary operations such as binary comparisons or binary divisions using the library HElib" \
4+
download="372.7MB" \
5+
size="1230MB" \
66
ram="Depends" \
77
cpu_usage="Depends" \
88
github="https://github.com/qdm12/hbc"
@@ -32,14 +32,23 @@ RUN GMP_V=6.1.2 && \
3232
wget -q https://github.com/shaih/HElib/archive/master.tar.gz && \
3333
tar -xzf master.tar.gz && \
3434
rm master.tar.gz && \
35-
mkdir -p /hbc/HElib/src /hbc/src /hbc/temp && \
36-
mv HElib-master/src/* /hbc/HElib/src/ && \
37-
rm -r HElib-master && \
38-
cd /hbc/HElib/src && \
35+
mkdir /HElibSrc && \
36+
mv /HElib-master/src/* /HElibSrc/ && \
37+
rm -r /HElib-master && \
38+
cd /HElibSrc && \
3939
make && \
4040
make check && \
41+
rm -rf Test_* *.o && \
4142
apt-get remove wget ca-certificates bzip2 -qq > /dev/null && \
4243
apt-get autoremove -qq > /dev/null && \
4344
rm -rf /var/lib/apt/lists/*
44-
VOLUME /hbc/src
45-
WORKDIR /hbc
45+
VOLUME /hbc
46+
WORKDIR /hbc
47+
ENTRYPOINT rm -rf /hbc/HElib/src && \
48+
mkdir -p /hbc/HElib/src && \
49+
mv /HElibSrc/* /hbc/HElib/src/ && \
50+
make && \
51+
printf "\n\n === Build successful === \n\n" && \
52+
printf "\n 1) You can recompile your program with 'make'\n" && \
53+
printf "\n 2) Run your program with './hbc'\n\n" && \
54+
/bin/bash

README.md

+11-18
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
[![](https://images.microbadger.com/badges/image/qmcgaw/homomorphic-binary-circuits.svg)](https://microbadger.com/images/qmcgaw/homomorphic-binary-circuits)
1818
[![](https://images.microbadger.com/badges/version/qmcgaw/homomorphic-binary-circuits.svg)](https://microbadger.com/images/qmcgaw/homomorphic-binary-circuits)
1919

20-
This project concerns the research and development of a real-use application of homomorphic encryption for cloud computing.
21-
The application takes advantage of the various possibilities and limitations of present homomorphic encryption schemes and
22-
programming libraries to remain usable in terms of time. The foundations of the application rely on the design of binary
23-
operations using homomorphic encryption. All the binary logic gates and various binary blocks were developed and adapted
24-
to provide enough functionalities to the application. The project focuses on providing features to cloud computing such as
25-
calculating averages on large amounts of encrypted numbers in a relatively short and decent time. The result is an application
26-
program interface written in C++ allowing to perform various operations on integers. It thus shows homomorphic encryption can
27-
be used today for simple operations if the security is more important than the speed of execution.
28-
2920
- Written in C++
3021
- Cross-platform using either:
3122
- Docker (see [Dockerfile](https://github.com/qdm12/hbc/blob/master/Dockerfile))
@@ -38,6 +29,8 @@ be used today for simple operations if the security is more important than the s
3829

3930
*This project was developed as my Master thesis at Imperial College London.*
4031

32+
This project concerns the research and development of a real-use application of homomorphic encryption for cloud computing. The application takes advantage of the various possibilities and limitations of present homomorphic encryption schemes and programming libraries to remain usable in terms of time. The foundations of the application rely on the design of binary operations using homomorphic encryption. All the binary logic gates and various binary blocks were developed and adapted to provide enough functionalities to the application. The project focuses on providing features to cloud computing such as calculating averages on large amounts of encrypted numbers in a relatively short and decent time. The result is an application program interface written in C++ allowing to perform various operations on integers. It thus shows homomorphic encryption can be used today for simple operations if the security is more important than the speed of execution.
33+
4134
## 1. Your own code
4235

4336
- By default, [*src/main.cpp*](https://github.com/qdm12/hbc/blob/master/src/main.cpp) runs all the unit tests of the project
@@ -57,21 +50,21 @@ Requirements:
5750
- An internet connection
5851

5952
1. Install Docker (from [here](https://www.docker.com/community-edition))
60-
1. Place the src directory from the hbc repository in `/yoursrcpath` in example
61-
1. Place the *makefile* from the hbc repository in `/yourmakefilepath` in example
53+
1. Place the **makefile** and the **src** directory from the hbc repository (or the whole repo) in `/yourpath` in example
6254
1. Enter the following command in your terminal:
6355

6456
```bash
65-
docker run -it --rm -v /yoursrcpath:/hbc/src -v /yourmakefilepath/makefile:/hbc/makefile qmcgaw/homomorphic-binary-circuits
57+
docker run -it --rm -v /yoursrcpath:/hbc qmcgaw/homomorphic-binary-circuits
6658
```
6759

68-
This will download the Docker image and mount the makefile and source files in the Docker container.
60+
This downloads the Docker image (the first time), mount the makefile and source files in the Docker container,
61+
compile your source code and run the compiled program. You can stop the execution with CTRL+C.
6962

7063
1. Edit the makefile and/or source files on your host machine
7164
1. Enter `make` in the Docker container to re-build the binary hbc
72-
1. Run the executable in the Docker container with `/hbc/hbc`
73-
1. To quit the Docker container and delete it, simply exit with `exit`
74-
65+
1. Run the executable in the Docker container with `./hbc` or even on your host
66+
1. To quit the Docker container and delete it, simply enter `exit`
67+
7568
### 2.2. Vagrant
7669

7770
![Docker](https://github.com/qdm12/hbc/raw/master/readme/vagrant.png)
@@ -247,7 +240,7 @@ In a terminal on your host machine, enter:
247240
docker image rm qmcgaw/homomorphic-binary-circuits
248241
```
249242

250-
Then delete the hbc/src directory on your host machine
243+
Then delete the hbc repository on your host machine
251244

252245
### 5.1 With Vagrant
253246

@@ -257,7 +250,7 @@ In a terminal on your host machine, enter:
257250
vagrant destroy
258251
```
259252

260-
Then delete the hbc/src directory on your host machine
253+
Then delete the hbc repository on your host machine
261254

262255
### 5.2 Otherwise
263256

makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ deepclean :
8080
rm -f /usr/local/include/gmp.h
8181
rm -f /usr/local/lib/libgmp.*
8282
rm -f /usr/local/lib/libntl.*
83-
rm -fr HElib
84-
rm -fr src
83+
rm -fr HElib src docs readme .dockerignore .gitignore .travis.yml README.md Dockerfile Vagrantfile
8584

8685
help :
8786
@echo make hbc - Compiles the project source code into an executable "hbc"

0 commit comments

Comments
 (0)