Blockchain Technology
Blockchain Technology
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.
• 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
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.