0% found this document useful (0 votes)
2 views

cryptography

The document discusses the RC4 algorithm, a symmetric stream cipher known for its simplicity and speed, but has faced security concerns leading to its decline in modern cryptography. It also covers the Secure Hash Algorithm (SHA) family, detailing SHA-1, SHA-2, and SHA-3, emphasizing their roles in ensuring data integrity and security. Additionally, it mentions the need for secure implementations of cryptographic algorithms, including a reference to the Diffie-Hellman algorithm.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

cryptography

The document discusses the RC4 algorithm, a symmetric stream cipher known for its simplicity and speed, but has faced security concerns leading to its decline in modern cryptography. It also covers the Secure Hash Algorithm (SHA) family, detailing SHA-1, SHA-2, and SHA-3, emphasizing their roles in ensuring data integrity and security. Additionally, it mentions the need for secure implementations of cryptographic algorithms, including a reference to the Diffie-Hellman algorithm.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

MADANAPALLE INSTITUTE OF TECHNOLOGY & SCIENCE

CRYPTOGRAPHY ALGORITHMS ASSIGNMENT-1

Name : S KHIZAR
Roll Number : 22695A3204
Course code : 20CSD609
Subject : CRYPTOGRAPHY ALGORITHMS
Year/sec : IV-A
Assignment : II

Questions:

(Set-B)
1) Explain about RC4 algorithm.
The RC4 calculation, otherwise called Rivest Code 4 or ARC4, is a symmetric
stream figure designed by Ron Rivest in 1987. It is generally perceived for its
effortlessness and speed in both programming and equipment executions. In
spite of the fact that RC4 was widely utilized in different applications, worries
about its security have arisen over the long run, prompting a decrease in its
utilization in present day cryptography.

Outline of RC4
RC4 is a symmetric key calculation, meaning it involves a similar key for both
encryption and decoding. It is delegated a stream figure, which scrambles
information each byte in turn, making it reasonable for applications that call for
quick and ongoing encryption, like secure organization correspondences. RC4's
plan is generally clear, comprising of two fundamental parts: the Key Booking
Calculation (KSA) and the Pseudo-Arbitrary Age Calculation (PRGA).

Parts of the RC4 Calculation


1. Key Booking Calculation (KSA)
The Key Booking Calculation is liable for instating a state exhibit utilizing a
mystery key. This is the way the KSA works:

Introduction: The state cluster, normally meant as S, contains 256 components


ordered from 0 to 255. The cluster is introduced so S[i] = I for all I. A helper
brief exhibit T is additionally made and loaded up with the vital material
rehashed as the need might arise.
Change of the State Cluster: The state exhibit S is then permuted in view of the
mystery key. This is finished by emphasizing through every one of the 256
places of S and utilizing a key-subordinate change. In particular:
A variable j is instated to 0.
For each file I from 0 to 255, j is refreshed utilizing the equation: j = (j + S[i] +
T[i]) % 256.
The upsides of S[i] and S[j] are then traded.
Yield: After 256 emphasess, the state exhibit S is completely instated and
prepared for use in the PRGA.
2. Pseudo-Arbitrary Age Calculation (PRGA)
The PRGA creates a keystream, which is XORed with the plaintext to deliver the
ciphertext (or with the ciphertext to recuperate the plaintext during
unscrambling). This is the way the PRGA capabilities:

Instatement: Two counters, I and j, are introduced to 0.


Keystream Age:
For every byte to be produced:
I is augmented by 1 and taken modulo 256: I = (I + 1) % 256.
j is refreshed in basically the same manner: j = (j + S[i]) % 256.
The upsides of S[i] and S[j] are traded.
The following byte of the keystream is acquired from the state exhibit S: K =
S[(S[i] + S[j]) % 256].
Encryption/Unscrambling: The keystream byte K is XORed with every byte of
the plaintext to deliver the ciphertext. The cycle is indistinguishable for
decoding since XORing the ciphertext with the equivalent keystream recuperates
the first plaintext.
Properties of RC4
Straightforwardness: RC4's calculation is not difficult to carry out and requires
insignificant computational assets, making it appropriate for conditions with
restricted handling power.
Variable Key Length: The vital length in RC4 can go from 40 pieces to 2048
pieces, giving adaptability in the degree of safety. Nonetheless, utilizing a key
that is too short can make the code helpless against beast force assaults.
Stream Code: Being a stream figure, RC4 is appropriate for scrambling
information streams, like in remote correspondences (WEP and WPA), secure
web traffic (SSL/TLS), and secure shell (SSH).
Security Concerns and Weaknesses
While RC4 was generally taken on before, different shortcomings have been
found over the long run. A portion of the key weaknesses include:

One-sided Result: RC4's keystream shows specific predispositions, especially in


the underlying bytes. These predispositions can be taken advantage of by
aggressors to recuperate portions of the plaintext or the encryption key,
particularly in conventions that reuse a similar key and keystream.
Key Reuse Weakness: Reusing similar key for numerous encryption meetings
can prompt the keystream being reused. Assuming that an assailant approaches
two ciphertexts encoded with the equivalent keystream, they can undoubtedly
uncover the plaintexts utilizing basic XOR tasks.
Frail Key Administration: Inappropriate key booking can make RC4 defenseless
to assaults. For instance, keys with powerless examples or unsurprising designs
can think twice about code's security.
Utilizations of RC4
By and large, RC4 was executed in a few significant encryption conventions,
including:
WEP (Wired Identical Protection): Utilized for getting Wi-Fi organizations,
however it was subsequently observed to be profoundly unreliable because of
imperfections in both the RC4 calculation and the WEP convention itself.
SSL/TLS (Secure Attachments Layer/Transport Layer Security): RC4 was
utilized to encode web traffic, yet because of weaknesses, it has been deplored
for safer calculations like AES.
Microsoft Windows: RC4 was likewise utilized in different parts of Microsoft
Windows working frameworks.
Belittling and Options
Because of its weaknesses, RC4 is not generally thought to be a solid encryption
technique and has been deplored in numerous cutting edge cryptographic norms.
For secure correspondences, options like the High level Encryption Standard
(AES) and ChaCha20 are currently liked. These calculations offer better
opposition against cryptanalysis and are suggested for new applications.
Conclustion.
RC4 assumed a critical part throughout the entire existence of cryptography,
offering a straightforward and quick technique for stream encryption. Be that as
it may, its security defects, particularly predispositions in the keystream and
weakness to key reuse, have prompted a decrease in its utilization. Today, more
vigorous calculations have supplanted RC4 to guarantee the security and
protection of information in different applications. Understanding RC4's
operations and shortcomings features the significance of consistent innovative
work in the area of cryptography to safeguard against developing dangers.
2) Explain briefly about secure Hash algorithm.
The Protected Hash Calculation (SHA) is a group of cryptographic hash
capabilities intended to guarantee information trustworthiness by creating a
fixed-size hash esteem from an information message of any length. The hash
esteem, frequently called a message digest, is novel to the information,
importance even a little change in the information will bring about a
fundamentally unique hash. This property makes SHA reasonable for different
security applications, for example, advanced marks, message confirmation
codes, and information respectability check.

Outline of SHA
SHA was created by the Public safety Organization (NSA) and distributed by the
Public Establishment of Norms and Innovation (NIST) as a Government Data
Handling Standard (FIPS). The SHA family incorporates a few variants, with
SHA-1, SHA-2, and SHA-3 being the most regularly examined.

1. SHA-1
Depiction: SHA-1 was the principal broadly embraced variant of the Protected
Hash Calculation, delivered in 1995. It produces a 160-piece hash esteem,
typically addressed as a 40-digit hexadecimal number.
Weakness: After some time, SHA-1 has been viewed as helpless against crash
assaults, where two unique information sources produce a similar hash esteem.
Subsequently, SHA-1 is viewed as unreliable for the vast majority cryptographic
purposes and is being gradually transitioned away from for safer calculations.
2. SHA-2 Family
Portrayal: SHA-2 is a superior adaptation of SHA-1 and comprises of a few hash
capabilities with various result lengths, including SHA-224, SHA-256, SHA-
384, and SHA-512. The numbers address the length of the hash esteem in bits.
For instance, SHA-256 produces a 256-bit hash.
Security: SHA-2 is safer than SHA-1 and is broadly utilized in current security
conventions, like HTTPS, computerized testaments, and blockchain innovation.
It utilizes a more intricate calculation that is impervious to crash and preimage
assaults.
3. SHA-3
Portrayal: SHA-3, otherwise called Keccak, was normalized in 2015 as an extra
individual from the SHA family. It is on a very basic level unique in relation to
SHA-1 and SHA-2, utilizing a wipe development technique rather than the
Merkle-Damgård structure.
Benefits: SHA-3 gives an additional layer of safety and is intended to
supplement SHA-2 as opposed to supplant it. It is impervious to all known types
of cryptographic assaults and is exceptionally flexible, making it reasonable for
a large number of uses.
How SHA Functions
Input Cushioning: The information message is cushioned to guarantee its length
is viable with the inside block size of the hash capability. Cushioning includes
adding a '1' digit followed by enough '0' bits and a portrayal of the message
length.
Message Parsing: The cushioned message is partitioned into blocks, which are
handled in succession. The block size differs relying upon the SHA variant (e.g.,
512 pieces for SHA-256).
Instatement: SHA calculations utilize a bunch of starting hash values, which are
characterized constants. These qualities are utilized as the beginning stage for
the hashing system.
Pressure Capability: Each block of the message is handled utilizing a
progression of consistent tasks, particular increments, and bitwise activities. The
pressure capability blends the message block with the ongoing hash worth to
create a refreshed hash.
Finish: Subsequent to handling all message impedes, the last hash esteem is
acquired by connecting the result of the last cycle.
Properties of a Safe Hash Calculation
Deterministic: a similar info will constantly create a similar hash esteem,
guaranteeing consistency and unwavering quality.
Irreversible: It is computationally infeasible to reproduce the first contribution
from its hash esteem, giving information security.
Impact Safe: It ought to be challenging to track down two unique information
sources that produce a similar hash esteem, guaranteeing information
trustworthiness.
Torrential slide Impact: A little change in the information ought to bring about a
fundamentally unique hash, improving security.
Fixed Result Length: No matter what the info size, the hash esteem has a proper
length, making it reasonable for stockpiling and transmission.
Utilizations of SHA
Information Honesty Check: SHA is utilized to confirm that information has not
been modified during transmission. By contrasting hash values when
transmission, one can recognize any unapproved alterations.
Computerized Marks: In computerized signature plans, SHA is utilized to hash a
message prior to marking it with a confidential key. This guarantees the
genuineness and respectability of the message.
Secret phrase Stockpiling: Hash capabilities like SHA-256 are utilized to store
passwords safely. Rather than putting away plaintext passwords, frameworks
store hash values, making it more hard for assailants to recover the first
passwords.
Blockchain: Digital forms of money like Bitcoin use SHA-256 to guarantee the
security and uprightness of exchanges. The hash capability is utilized during the
time spent digging and for connecting blocks in the blockchain.
Testament Age: SHA is utilized to produce endorsements that confirm the
personality of sites and encode information communicated over the web.
Security Contemplations
While SHA-2 is as yet viewed as secure and broadly utilized, the continuous
progressions in computational power and cryptographic examination may
ultimately require the utilization of significantly safer calculations like SHA-3.
Associations are encouraged to change away from SHA-1 and take on more
grounded hash capabilities to safeguard delicate data.

End
The Solid Hash Calculation family assumes a basic part in present day
cryptography, offering devices for guaranteeing information honesty and
security. While SHA-1 has been expostulated because of weaknesses, SHA-2
and SHA-3 keep on giving strong security answers for different applications.
Understanding how these calculations work and their suitable use cases is
fundamental for building secure frameworks in the present computerized scene.

3) Write a program for implementation of Diffie-Hellman Algorithms.

You might also like