Project Chiffrement Symetrique OpenSSL PDF
Project Chiffrement Symetrique OpenSSL PDF
The objective of this project is to describe openSSL. The following steps will be considered
1. History/Author of OpenSSL
2. OpenSSL webpage
3. Libraries and main documentation of openSSL
4. Installation of OpenSSL ( platform consideration)
5. Features of OpenSSL
6. OpenSSL interfaces
7. Standard openSSL commands with examples
8. Encoding and decoding ( Bases, ASCIII,....) with OpenSSL
9. Introduction to programming with openSSL
0.1 Overview-Objectives
The learning objective of this lab is for students to get familiar with the concepts in the secret-
key encryption. After nishing the lab, students should be able to gain a rst-hand experience on
encryption algorithms, encryption modes, paddings, and initial vector (IV). Moreover, students will
be able to use tools and write programs to encrypt/decrypt messages.
[frame=single]
% openssl enc ciphertype -e -in plain.txt -out cipher.bin \
-K 00112233445566778889aabbccddeeff \
-iv 0102030405060708
Please replace the ciphertype with a specic cipher type, such as -aes-128-cbc, -aes-128-cfb,
-bf-cbc, etc. In this task, you should try at least 3 dierent ciphers and three dierent modes. You
can nd the meaning of the command-line options and all the supported cipher types by typing "man
enc". We include some common options for the openssl enc command in the following :
[frame=single]
-in <file> input file
-out <file> output file
-e encrypt
-d decrypt
-K/-iv key/iv in hex is the next argument
-[pP] print the iv/key (then exit if -P)
1. The openssl manual says that openssl uses PKCS5 standard for its padding. Please design
an experiment to verify this. In particular, use your experiment to gure out the paddings in
the AES encryption when the length of the plaintext is 20 octets and 32 octets.
2. Please use ECB, CBC, CFB, and OFB modes to encrypt a le (you can pick any cipher).
Please report which modes have paddings and which ones do not. For those that do not need
paddings, please explain why.
Note 1 : If you choose to store the plaintex message in a le, and feed the le to your program,
you need to check whether the le length is 21. Some editors may add a special character to the end
of the le. If that happens, you can use a hex editor tool to remove the special character.
Note 2 : In this task, you are supposed to write your own program to invoke the crypto library.
No credit will be given if you simply use the openssl commands to do this task.
Note 3 : To compile your code, you may need to include the header les in openssl, and link to
openssl libraries. To do that, you need to tell your compiler where those les are. In your Makefile,
you may want to specify the following :
[frame=single]
INC=/usr/local/ssl/include/
LIB=/usr/local/ssl/lib/
all:
gcc -I$(INC) -L$(LIB) -o enc yourcode.c -lcrypto -ldl
0.3 Submission
You need to submit a detailed lab report to describe what you have done and what you have
observed ; you also need to provide explanation to the observations that are interesting or surprising.
In your report, you need to answer all the questions listed in this lab.
0.4 Ressources
Please visit
http://www.cis.syr.edu/~wedu/seed/
for more information and additional les for this project.