Work done by CHEBBAH Mehdi
Table of ContentsIntroductionImplementationPhase 1: Creation of key pairs1. Script for creating key pairsObtained results:Note:Phase 2: Session key exchange1. Session key generation and encryption scriptObtained results:Note:2. Decryption script and verification of non-repudiation and integrity of the session keyObtained results:Phase 3: Exchange of messages1. Messages encryption scriptObtained results:Note:2. Messages decryption script Obtained results:Note:
In this tutorial we will implement a hybrid secure exchange protocol that guarantees the following security services:
For this we will try to implement the system whose design has been previously established:
Concerning this part, we will divide it into 3 phases:
In this phase each of the two protagonists will create their own key pair a public key and a private key (
pkA.pemin the current directory (of Alice)
Re-execute the script in Bob's directory changing
In the opening of the session Alice will randomly generate a session key that will be communicated to Bob, this key will be encrypted using Bob's public key, the signature will be guaranteed in this transfer (this is the role of asymmetric encryption in this hybrid system)
kABfile containing the session key.
kAB.cryptfile containing the
kAB.md5.signfile containing the session key's hash signature.
The two files (
kAB.md5.sign) will be sent to Bob and deleted from Alice's directory
kABfile containing the session key sent by Alice
After the establishment of the two previous phases it is now possible to send messages between Alice and Bob using symmetric encryption for confidentiality and private key encryption for signature
Message.cryptecontaining the message encrypted with the session key kAB.
Message.md5.signcontaining the signature of the message hash
The two files (
Message.md5.sign) will be sent to Bob and then deleted from Alice's directory
Message.txtcontaining the message received from Alice.
Message.txt') in case the transmission is correct (the received message is the same as the sent message). Or the display of a failure message ('Message transmission failed (The message has been modified).') in case the sent message and the received message are different.
Bob can now read the message sent by Alice.