Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ic:laboratoare:11 [2018/12/11 19:55]
dan.dragan [Exercise 2: RSA parity oracle (4p)]
ic:laboratoare:11 [2020/11/05 17:53] (current)
acosmin.maria
Line 1: Line 1:
-===== Laboratorul ​11 - Public key encryption =====+===== Laboratorul ​10 - Public key encryption =====
  
 In this lab we'll do some cool exercises using public key encryption methods for key exchange and data encryption. In this lab we'll do some cool exercises using public key encryption methods for key exchange and data encryption.
- 
-Before starting the labs, download openssl 1.1.0 from [[https://​www.openssl.org/​source/​openssl-1.1.0c.tar.gz|here]]. 
-Save the file to some local folder accessible by you, then compile it and install it to some folder. 
-Open the unpacked folder from bash, and run the following commands: 
-<code bash> 
-linux$ ./config --prefix=/​home/​student/​local --openssldir=/​home/​student/​local/​openssl 
-linux$ make 
-linux$ make test 
-linux$ make install 
-</​code>​ 
-(in case of trouble, check also the instructions at the end of [[http://​ocw.cs.pub.ro/​courses/​ic/​laboratoare/​09|lab 9]]). 
- 
-While the tools are building/​compiling you may start working on some of the exercises. 
  
  
Line 26: Line 13:
 Download the lab code from {{:​ic:​laboratoare:​lab11.zip|here}}. After unzipping, you'll find the source code Download the lab code from {{:​ic:​laboratoare:​lab11.zip|here}}. After unzipping, you'll find the source code
 for a client (dhe.c) and a server (dhe_server.c),​ along with a Makefile and fixed Diffie-Hellman p and g params in the files dhparam.pem. for a client (dhe.c) and a server (dhe_server.c),​ along with a Makefile and fixed Diffie-Hellman p and g params in the files dhparam.pem.
- 
-<​note>​ 
-Update the Makefile with the paths relevant to your installation folders 
-</​note>​ 
  
 The client and server have a similar structure. Each of them should build a public key, then send it to the other party, receive the public key from the other party and finally compute the secret key. Your task is to complete the missing parts. For this, consult the openssl documentation [[https://​www.openssl.org/​docs/​man1.1.0/​crypto/​|here]]. Since they are similar, focus only on one of them and then do similarly on the other one. The client and server have a similar structure. Each of them should build a public key, then send it to the other party, receive the public key from the other party and finally compute the secret key. Your task is to complete the missing parts. For this, consult the openssl documentation [[https://​www.openssl.org/​docs/​man1.1.0/​crypto/​|here]]. Since they are similar, focus only on one of them and then do similarly on the other one.
Line 39: Line 22:
 If all goes well, you should see the same secret key on both client and server. If all goes well, you should see the same secret key on both client and server.
  
-<hidden+Before starting this task, check that you have openSSL installed (in this lab we'll use openSSL 1.1.0): 
-The solution ​is {{:ic:laboratoare:lab_dhe_solved.zip|here}}+<code
-</hidden>+#openssl version 
 +</​code>​ 
 + 
 +Also, make sure that you have "​libssl-dev"​ installed (ask your lab supervisor to help you if this is missing, e.g. if you cannot find header files during compilation). 
 + 
 +<​note>​ 
 +If you need to install openSSL on your own machine, download openssl 1.1.0 from [[https://​www.openssl.org/​source/​openssl-1.1.0c.tar.gz|here]]. 
 +Save the file to some local folder accessible by you, then compile it and install it to some folder. 
 +Open the unpacked folder from bash, and run the following commands: 
 +<code bash> 
 +linux$ ./config --prefix=/​home/​student/​local --openssldir=/​home/​student/​local/​openssl 
 +linux$ make 
 +linux$ make test 
 +linux$ make install 
 +</​code>​ 
 +(in case of trouble, check also the instructions at the end of [[http://ocw.cs.pub.ro/​courses/​ic/​laboratoare/​09|lab 9]]). 
 + 
 +Make sure to update the Makefile with the paths relevant to your installation folders if you do your own install. 
 + 
 +While the tools are building/​compiling you may start working on the other exercises
 +</note> 
 + 
 +<note tip> 
 +For some distributions (e.g. ubuntu), you might need to put the "​-lcrypto"​ flag for compilation at the end. 
 +That is, having the compile lines in the Makefile like this: 
 +<​code>​ 
 +#gcc -L/​usr/​local/​lib dhe.c -o dhe -lcrypto 
 +</​code>​ 
 +</​note>​ 
 + 
  
 === Bonus 1 === === Bonus 1 ===
Line 172: Line 185:
  
 </​file>​ </​file>​
- 
-<​hidden>​ 
-The solution is {{:​ic:​laboratoare:​lab11_sol.zip|here}}. 
-</​hidden>​ 
ic/laboratoare/11.1544550917.txt.gz · Last modified: 2018/12/11 19:55 by dan.dragan
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0