1. 1
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
Student Name :P.YUVARAJU
Department :CSE
Course :CRYPTOGRAPHY&NETWORK SECURITY
LAB
Course code :20CS607
Roll no :22NU1A0587
3. 3
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
PROGRAM OUTCOMES
SNO OUTCOMES DESCRIPTION
1 Engineering Knowledge Apply the knowledge of mathematics , science, engineering fundamentals and an
engineering specialization to the solution of complex engineering problems .
2 Problem Analysis Identify , formulate, research literature &analyze complex engineering problems reaching
substantiated conclusions using first principles of mathematics , natural science , engineering
science .
3 Design/Development of
solution
Design solutions for complex engineering problems and design system components of
processes that meet the specified needs with appropriate consideration for the public health
safety and the cultural, societal and environmental considerations
4 Conduct Investigations of
complex problems
Use research –based knowledge and research methods including design of experiments and
interpretation of data and synthesis of the information to provide valid conclusions
5 Modern tool usage Create, select and apply appropriate techniques, resources and modern engineering and IT
tools including prediction and modeling to complex engineering activities with an
understanding of the limitations .
6 The Engineering and society Apply reasoning informed by the contextual knowledge to assess societal ,health ,safety ,
legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice
4. 4
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
PROGRAM OUTCOMES
SNO OUTCOMES DESCRIPTION
7 Environmental and
sustainability
Understand the impact of professional engineering solutions and environmental contexts and
demonstrate the knowledge of and need for sustainable development
8 Ethics Apply ethical principles and commit to professional ethics and responsibilities and norms of
engineering practice.
9 Individual and teamwork Function effectively as an individual , and as a member or leader in diverse terms and in
multidisciplinary settings
10 Communication Communicate effectively on complex engineering activities with the engineering community
and with society at large such as being able to comprehend and write effective reports and
documentation, make effective presentation, and give and receive clear instructions .
11 Project management and
finance
Demonstrate knowledge and understanding of the engineering and management principles
and apply theses to one’s own work ,as a member and leader in a team ,to manage projects
and in multidisciplinary environments.
12 Lifelong Learning Recognize the need for and have the preparation and ability to engage in independent and
life-long learning in the broadest context of technological change.
5. 5
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
COURSE OUTCOMES
Code Course Outcomes
20CS607.1 Create and apply the role of languages like HTML, CSS
20CS607.2 Build dynamic web pages using JavaScript
20CS607.3 Create and apply the role of language like XML
20CS607.4 Develop Web Applications using PHP & MySql
20CS607.5 Install & Use Frameworks
7. 7
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
SHA-1 ALOGRITHM:
The SHA-1 (Secure Hash Algorithm 1) is a widely used cryptographic
hash function that generates a 160-bit hash value from any input data.
It’s commonly represented as a 40-character hexadecimal number. SHA-
1 is primarily utilized in applications that require data integrity, such as
digital signatures, certificate verification, and version control systems.
However, over time, vulnerabilities have been discovered in SHA-1,
making it less secure against collision attacks where two different inputs
produce the same hash. As a result, it has been largely replaced by more
secure algorithms like SHA-256 and SHA-3 in modern cryptographic
practices. Despite its declining use, SHA-1 remains an essential part of
cryptographic history and has paved the way for stronger hashing
mechanisms.
8. 8
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
Source code
import hashlib
# Input text
text = "This is a sample message"
# Encode the text to bytes
text_bytes = text.encode()
# Create SHA-1 hash object
sha1_hash = hashlib.sha1()
# Update the hash object with the bytes
sha1_hash.update(text_bytes)
# Get the hexadecimal digest
digest = sha1_hash.hexdigest()
print("SHA-1 Message Digest:", digest)
9. 9
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
OUTPUT
Message Digest (SHA-1): b2e98ad6f6eb8508dd6a14cfa704bad7f05f6fb1
10. 10
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
DIGITAL SIGNATURE SCHEMA:
The Digital Signature Standard (DSS) is a federal standard for digital
signatures, established by the United States in 1994. It specifies
algorithms that ensure the authenticity and integrity of digital messages
or documents. DSS primarily employs the Digital Signature Algorithm
(DSA), which is based on public-key cryptography. Using DSS, a sender
can generate a digital signature for a message, allowing the recipient to
verify its authenticity using a public key. This protects against
unauthorized tampering and guarantees the source of the message.
DSS is widely used in secure communications, certificate authorities,
and data verification systems. Over time, its algorithms have been
enhanced to keep up with modern cryptographic security demands.
11. 11
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
SOURCE CODE:
from Crypto.PublicKey import DSA
from Crypto.Signature import DSS
from Crypto.Hash import SHA256
key = DSA.generate(2048)
msg = input("Enter the message to sign: ").encode('utf-8')
hash_obj = SHA256.new(msg)
signer = DSS.new(key, 'fips-186-3')
signature = signer.sign(hash_obj)
print("nGenerated Signature:", signature.hex())
public_key = key.publickey()
verifier = DSS.new(public_key, 'fips-186-3')
verify_msg = input("nEnter the message to verify: ").encode('utf-8')
verify_hash = SHA256.new(verify_msg)
try:
verifier.verify(verify_hash, signature)
print("Signature is VALID. The message is authentic.")
except ValueError:
print("Signature is INVALID. The message may have been altered.")
12. 12
Nadimpalli Satyanarayana Raju Institute of Technology (NSRIT)
OUTPUT:
Message: b'Hello, this is a secure message!’
Digital Signature: b'x1fx85x06...x9d' # (A long binary string - exact value varies)
The message is authentic