Course Title: Information Course Code: BCSE354E
Security Management
Faculty: Prof.Sendhil R Slot: L33+L34
Regno:21BCE5937 Name: Arin Yadav
Program:BCE(CSE CORE) Batch Year:THIRD
School:Scope Submission Date:15-04-2024
LAB EXERCISE-8
To understand the functioning of the Digital
Signature
Procedure:
1. Creating a digital signature for a given text file.
2. To encrypt and decrypt the text file and verify Digital Signature.
SOFTWARE REQUIRED: VM Virtual Box, Kali Linux OS
Execute the commands stated below:
openssl genrsa -des3 -out private.pem 2048
Generate private key with length 2048. Now enter a passphrase, and remember that passphrase.
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Generate public key.
Echo “lab10.pvt”>mssg.txt
We will take a text file ‘mssg.txt’ which contains data ‘lab10.pvt’.
openssl dgst -sha1 -sign private.pem -out sign mssg.txt
Create digital signature. The below command will create a file ‘sign’ that contains digital
signature.
openssl dgst -sha1 - verify public.pem - signature sign mssg.txt
To verify the digital signature.
openssl enc -aes-256- cbc -base64 -in mssg.txt
openssl enc -aes-256-cbc -base64 -in mssg.txt
Send the encrypted data to the receiver.
openssl enc -aes-256-cbc -d -base64 -in out.txt -out outDecrypted.txt
In the receiver end, decrypt the out.txt file
openssl dgst -sha1 -verify public.pem -signature sign outDecrypted.txt
Verify the digital signature to check for the correctness of the file.