0% found this document useful (0 votes)
27 views6 pages

21BCE5937 ArinYadav BCSE354E LAB8

The document provides instructions on understanding the functioning of digital signatures. It outlines steps to create a private and public key, generate a digital signature for a text file, encrypt and decrypt the file, and verify the digital signature.

Uploaded by

Divyanshu Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views6 pages

21BCE5937 ArinYadav BCSE354E LAB8

The document provides instructions on understanding the functioning of digital signatures. It outlines steps to create a private and public key, generate a digital signature for a text file, encrypt and decrypt the file, and verify the digital signature.

Uploaded by

Divyanshu Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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.

You might also like