You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
Checked Vagrant works with the latest NTL 10.5.0 and HElib. Readme.md has been updated and Cygwin has been checked as non-working still (see readme.md). The level of the multiplier circuit has been increased by 1 to prevent a warning message from displaying (although it was working). In the end, everything works with Vagrant and should work by manually installing everything as well.
-**Presentation** available on [Dropbox][dropbox_pres], on [Github][github_pres] and on [Youtube](https://www.youtube.com/watch?v=n-adgQWZYxI) where I present it.
37
50
- Report available on [Github][github_report] or on [Dropbox][dropbox_report]
38
51
- Comments in the source code, especially in _he.cpp_
39
52
53
+
40
54
## 6. Abstract ##
41
55
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.
42
56
57
+
43
58
## 7. How do I run it?
59
+
44
60
### 7.1 Using Vagrant (easiest, compatible with all, most flexible)
45
61
1. Install git on your computer
46
62
-`apt-get install -y git` for Linux machines
@@ -88,87 +104,120 @@ This basically launches an Ubuntu-based virtual machine with only what is necess
88
104
8. Install it with `make install`
89
105
9. *Optionally*, check it with `make check`
90
106
10. Go back and remove used files with `cd .. && rm -fr gmp-6.1.2*`
91
-
10. Download NTL with `curl http://www.shoup.net/ntl/ntl-9.9.1.tar.gz > ntl-9.9.1.tar.gz`
92
-
11. Extract it and go to its directory with `tar -xvzf ntl-9.9.1.tar.gz && cd ntl-9.9.1/src`
107
+
10. Download NTL with `curl http://www.shoup.net/ntl/ntl-10.5.0.tar.gz > ntl-10.5.0.tar.gz`
108
+
11. Extract it and go to its directory with `tar -xvzf ntl-10.5.0.tar.gz && cd ntl-10.5.0/src`
93
109
12. Configure it with `./configure NTL_GMP_LIP=on`
94
110
13. Build it with `make`
95
111
14. Install it with `make install`
96
-
15. Go back and remove used files with `cd ../.. && rm -fr ntl-9.9.1*`
112
+
15. Go back and remove used files with `cd ../.. && rm -fr ntl-10.5.0*`
97
113
16. Clone HElib with with `git clone https://github.com/shaih/HElib.git`
98
114
17. Go to its src directory `cd HElib/src`
99
115
18. Build it with `make`
100
116
19. *Optionally*, check it with `make check` and test it with `make test`.
101
117
20. Go back to the working directory with `cd ../..`
102
118
- Other Linux OSes
103
-
1. Install the libaries with (add `*sudo*` maybe) `apt-get install git g++ m4 perl libboost-all-dev`
119
+
1. Install the libaries with (add `sudo` maybe) `apt-get install git g++ m4 perl libboost-all-dev`
104
120
2. Download GMP with `wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2`
105
121
3. Extract it and go to its directory with `tar -xvjf gmp-6.1.2.tar.bz2 && cd gmp-6.1.2`
106
122
4. Configure it with `./configure`
107
123
5. Build it with `make`
108
124
6. Install it with `make install`
109
125
7.*Optionally*, check it with `make check`
110
126
8. Go back and remove used files with `cd .. && rm -fr gmp-6.1.2*`
111
-
9. Download NTL with `wget http://www.shoup.net/ntl/ntl-9.9.1.tar.gz`
112
-
10. Extract it and go to its directory with `tar -xvzf ntl-9.9.1.tar.gz && cd ntl-9.9.1/src`
127
+
9. Download NTL with `wget http://www.shoup.net/ntl/ntl-10.5.0.tar.gz`
128
+
10. Extract it and go to its directory with `tar -xvzf ntl-10.5.0.tar.gz && cd ntl-10.5.0/src`
113
129
11. Configure it with `./configure NTL_GMP_LIP=on`
114
130
12. Build it with `make`
115
131
13. Install it with `make install`
116
-
14. Go back and remove used files with `cd ../.. && rm -fr ntl-9.9.1*`
132
+
14. Go back and remove used files with `cd ../.. && rm -fr ntl-10.5.0*`
117
133
15. Clone HElib with with `git clone https://github.com/shaih/HElib.git`
118
134
16. Go to its src directory `cd HElib/src`
119
135
17. Build it with `make`
120
136
18.*Optionally*, check it with `make check` and test it with `make test`.
121
137
19. Go back to the working directory with `cd ../..`
122
138
- Cygwin 32 bit and 64 bit
123
-
1. It will not work for mysterious reasons, sorry ! Use Vagrant !
139
+
- It will fail when you try to install NTL with the NTL_CMP_LIP=on because cygwin does not find the -lgmp libary for some reason.
140
+
- So just switch to use Vagrant. I might be missing something but there is no point digging to deep here I believe.
6. Compile the objects into hbc `g++ objects/*.o HElib/src/fhe.a -o hbc -L/usr/local/lib -lntl -lgmp -lm`
182
+
6. Compile the objects into *hbc*`g++ objects/*.o HElib/src/fhe.a -o hbc -L/usr/local/lib -lntl -lgmp -lm`
138
183
5. Run hbc
139
-
- If on Vagrant, `cd /vagrant` first
140
-
- Run it with `./hbc` && Enjoy ! (Careful about having enough **RAM**)
184
+
- Run it with `./hbc` (Careful about having enough **RAM**)
141
185
- You can also build it and run the new build with `make hbcNrun`
142
-
6. RAM considerations **IMPORTANT**
143
-
- To run the default hbc program, you need at least 3GB of ram.
144
-
- This is because the average operation (arithmetic tests) uses about 2GB of ram for 2 bits.
186
+
187
+
188
+
## 8. RAM considerations **IMPORTANT**
189
+
- To run the default hbc program, you need at least 3GB of RAM.
190
+
- This is because the average operation (arithmetic tests) uses about 2GB of RAM for 2 bits.
145
191
- Note that you can comment it out in the main.cpp or TEST_ARITHMETIC.cpp
146
192
and stick to tests of simpler circuits such as the multiplication which
147
-
only require about 0.7 - 1GB of ram. You can modify the amount of RAM of
148
-
Vagrant in the vb.memory field, which is set to 2600MB by default.
149
-
- To monitor the RAM on Vagrant, open a new host terminal, go to the working
150
-
directory and use `vagrant ssh -c htop`.
151
-
7. CPU considerations
193
+
only require about 0.7 - 1GB of RAM.
194
+
- For **Vagrant**, you can modify the amount of RAM in the **vb.memory** field,
195
+
which is set to **2600MB** by default. To monitor the RAM usage, open a new
196
+
host terminal, go to the working directory and use `vagrant ssh -c htop`.
197
+
198
+
199
+
## 9. CPU considerations for Vagrant
152
200
- By default, the Vagrant VM uses 2 cores of your CPU (vb.cpus = 2) so that
153
201
you can run hbc and also monitor the RAM with another `vagrant ssh`.
154
202
- You can also run more instances of hbc if you have more than two cores available.
155
203
With Vagrant, just set vb.cpus to 3 for example, log in with `vagrant ssh` on different
156
-
host terminals and run hbc (provided you have enough ram to run both obviously).
204
+
host terminals and run hbc (provided you have enough RAM to run both obviously).
157
205
206
+
207
+
## 10. Remove and uninstall ##
158
208
159
-
## 8. Remove and uninstall ##
160
-
### 8.1 With Vagrant
161
-
Just enter `vagrant destroy` from your host machine in the working directory
209
+
### 10.1 With Vagrant
210
+
Just enter `vagrant destroy` from your host machine in the working directory.
162
211
163
-
### 8.2 With Debian and Ubuntu
212
+
### 10.2 Otherwise
164
213
Use the makefile and run `make deepclean` which uninstalls and delete:
165
214
- hbc
166
215
- HElib, NTL, GMP
167
216
- perl, m4, git, gcc-g++ and libboost-all-dev and purge them.
168
217
Only the makefile will remain in the folder.
169
218
170
219
171
-
## 9. Acknowledgements ##
220
+
## 11. Acknowledgements ##
172
221
Credits to **Shai Halevi** for HElib obviously and thanks for the quick help tips in the Issues section!
173
222
174
223
Thanks to **Dr. Wei Dai** (Imperial College London) for introducing me to homomorphic encryption
@@ -182,15 +231,15 @@ Thanks to **Wei Dai** from the Vernam Group at Worcester Polytechnic Institute f
182
231
Thanks to **my dad**, **mother** and **step-mother** for their continuous support throughout my studies.
183
232
184
233
185
-
## 10. Contribution
234
+
## 12. Contribution
186
235
You're welcome to contribute to this repository if you find any better circuits or other circuits and implement them !
187
236
188
237
Just send me an email (see my address at the start) and I will add you as a contributor.
189
238
190
239
Don't hesitate to contact me if you have any question as well.
191
240
192
241
193
-
## 11. Future Work (ideas crossing my mind) ####
242
+
## 13. Future Work (ideas crossing my mind) ####
194
243
- Use *= instead of multiplyBy when the level is very low as it is faster. multiplyBy uses relinearization which serves to reduce the size of ciphertexts. This is great for complex circuits but takes a longer time than *= for simple circuits.
195
244
- Add circuits from [here](http://www.aoki.ecei.tohoku.ac.jp/arith/mg/algorithm.html) to the core API *he.cpp*.
196
245
- Other ideas are in chapter 9: _Future work_ of my report.
0 commit comments