0% found this document useful (0 votes)
30 views21 pages

Blockchain Technology

Cryptography is the mathematical science of encrypting and decrypting data to ensure secure communication, involving techniques for confidentiality, integrity, authentication, and non-repudiation. It is divided into symmetric key cryptography, which uses a single key, and asymmetric key cryptography, which uses a public and private key pair. Cryptographic methods, including hash functions and digital signatures, play a critical role in securing data across various applications, from online transactions to military communications.
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)
30 views21 pages

Blockchain Technology

Cryptography is the mathematical science of encrypting and decrypting data to ensure secure communication, involving techniques for confidentiality, integrity, authentication, and non-repudiation. It is divided into symmetric key cryptography, which uses a single key, and asymmetric key cryptography, which uses a public and private key pair. Cryptographic methods, including hash functions and digital signatures, play a critical role in securing data across various applications, from online transactions to military communications.
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/ 21

Unit -2

Cryptography
Cryptography
 Cryptography is the science of using mathematics to encrypt and decrypt data.
 Cryptography is the practice of secure communication in the presence of third
parties.
 It involves techniques for secure communication, authentication, confidentiality,
and integrity of data.

• A message is plaintext (sometimes called cleartext). The process of disguising a


message in such a way as to hide its substance is encryption. An encrypted
message is ciphertext. The process of turning ciphertext back into plaintext is
decryption.
• While cryptography is the science of securing data, cryptanalysis is the science of
analyzing and breaking secure communication.
• Classical cryptanalysis involves an interesting combination of analytical reasoning,
application of mathematical tools, pattern finding, patience, determination, and
luck.
• Cryptanalysts are also called attackers.
• Cryptology embraces both cryptography and cryptanalysis
History
Cryptographic Goals

• Goal: The primary goal of cryptography is to secure important data on the hard
disk or as it passes through a medium that may not be secure itself. Usually, that
medium is a computer network.
Services
• Confidentiality (secrecy)
- Ensuring that no one can read the message except the intended receiver.
- Data is kept secret from those without the proper credentials, even if that data
travels through an insecure medium.

• Integrity (anti-tampering)
- Assuring the receiver that the received message has not been altered in any
way from the original.
• Authentication
- Cryptography can help establish identity for authentication purposes The
process of proving one's identity.

• Non-repudiation
- A mechanism to prove that the sender really sent this message
Cryptography

 Cryptography can be divided into two main categories:


 symmetric key cryptography and asymmetric key cryptography.
 Symmetric key cryptography uses the same key for both encryption and
decryption, while asymmetric key cryptography uses two different keys, a public
key for encryption and a private key for decryption.
 In asymmetric key cryptography, the security of the system depends on the
difficulty of a mathematical problem, such as factoring large numbers, or the
discrete logarithm problem.
 In addition to encryption algorithms, there are other cryptographic techniques that
can be used to ensure the integrity and authenticity of data. These include digital
signatures, message authentication codes (MACs), and hash functions.
 Cryptography plays a critical role in ensuring the security of data and
communication in many applications, from secure online transactions to military
and government communication
Commonly used Cryptographic Primitives
• One-way hash function - Integrity
• Symmetric Key Cryptography – Confidentiality, Authentication
• Asymmetric key cryptography – Confidentiality, Authentication
• Digital Signature – Authentication, Non-repudiation
• Private information Retrieval(PIR)-Confidentiality
Symmetric Key Encryption
 Symmetric Key Encryption is a process of converting plaintext to ciphertext by using a single key.
 In this process, block-cipher and stream-cipher are the two major categories.
 Block cipher performs encryption and decryption a block of text at a time, whereas in-stream ciphertext
encryption and decryptions are performed one byte at a time.
 The major advantages of symmetric key encryption are high speed and low power consumption.

 Some of the examples of symmetric encryption algorithms are


 Data Encryption Standard (DES), Advanced Encryption Standard (AES), Blowfish, and twofish etc.
The Symmetric Cipher Model:
A symmetric cipher model is composed of five essential parts:

1. Plain Text (x): This is the original data/message that is to be communicated to the receiver by the
sender. It is one of the inputs to the encryption algorithm.
2. Secret Key (k): It is a value/string/textfile used by the encryption and decryption algorithm to encode
and decode the plain text to cipher text and vice-versa respectively. It is independent of the encryption
algorithm. It governs all the conversions in plain text. All the substitutions and transformations done
depend on the secret key.
3. Encryption Algorithm (E): It takes the plain text and the secret key as inputs and produces Cipher
Text as output. It implies several techniques such as substitutions and transformations on the plain text
using the secret key.
E(x, k) = y
4. Cipher Text (y): It is the formatted form of the plain text (x) which is unreadable for humans, hence
providing encryption during the transmission. It is completely dependent upon the secret key provided
to the encryption algorithm. Each unique secret key produces a unique cipher text.
5. Decryption Algorithm (D): It performs reversal of the encryption algorithm at the recipient’s side. It
also takes the secret key as input and decodes the cipher text received from the sender based on the
secret key. It produces plain text as output.
D(y, k) = x
Applications of Symmetric Key Cryptography
• Banking Applications – to authenticate ID and transactions
• Server and Data Center Information can be encrypted at rest
Asymmetric Key Cryptography
• Otherwise called Public Key Cryptography (PKI).
• PKI uses two keys- Public and Private to encrypt and decrypt a message.
• Public Key – Designed to be in Public. Can be shared anywhere on internet.
Used in Encryption Process. Also used for user Authentication.
• Private Key- Kept Secret and never shared. Used in decryption process.
• Why PKI?
• Symmetric- Single Key- Data loss, Unauthorized
• More secure because of two keys.
• Helps in user authentication.
Working of Asymmetric Encryption
Limitations of Public Key Cryptography
• Vulnerable to Brute Force Attacks
• Alg. Fails if private key is lost.
• Vulnerable to Man-in-the Middle Attacks.
• More Complex
• Benefits:
• Authentication
• Data integrity
• Data confidentiality
• Non-repudiation
• Key management
• Digital signatures
Asymmetric Encryption Algorithms
• Rivest Shamir Adleman (RSA)
• the Digital Signature Standard (DSS), which incorporates the Digital
Signature Algorithm (DSA)
• Elliptical Curve Cryptography (ECC)
• the Diffie-Hellman exchange method
• TLS/SSL protocol
Blockchain Hash Function
• A hash function is a mathematical function that takes an input
string of any length and converts it to a fixed-length output
string. The fixed-length output is known as the hash value.

What is Hashing?
Hashing consists of converting a general string of information into an intricate piece of data. This is done
to scramble the data so that it completely transforms the original value, making the hashed value utterly
different from the original.
Hash Function
• Produces unique value of fixed length in seconds.
• No limitations on data or size anything can be hashed.
• Less computational power to hash.
• One way function.
What an Hash Function do?
• Ensure data integrity,
• Secure against unauthorized modifications,
• Protect stored passwords, and
• Operate at different speeds to suit different purposes.
Hash Function Properties
• To be cryptographically secure and useful, a hash function should have the following properties:

Collision resistant: Give two messages m1 and m2, it is difficult to find a hash
value such that hash(k, m1) = hash(k, m2) where k is the key value.
Preimage resistance: Given a hash value h, it is difficult to find a message m
such that h = hash(k, m).
Second preimage resistance: Given a message m1, it is difficult to find another
message m2 such that hash(k, m1) = hash(k, m2).
Deterministic: A hash function must be deterministic, which means that for any
given input a hash function must always give the same result.
Avalanche Effect: This means for a small change in the input, the output will
change significantly.
Puzzle Friendliness: Given X and Y find out k such that Y=H(X||k)- used in
Bitcoing mining(PoW).
Fixed-length Mapping: For any input of fixed length, the hash function will
always generate the output of the same length.
Where is it being used?
• Hash functions are used in cryptography and have variable levels of
complexity and difficulty.
• Hash functions are used for cryptocurrency, password security, and
message security.
Digital Signature
A digital signature is a mathematical technique used to validate the authenticity and integrity of a
message, software, or digital document.

You might also like