Cryptography in Blockchain Applications - Updated
Cryptography in Blockchain Applications - Updated
Cryptography
Outline
The blockchain foundation concepts
Blockchain foundation concept roles
Cryptography
How cryptography works in general
Hashing Algorithms in Blockchain
Types of cryptography
Symmetric Vs Asymmetric Encryption
Cryptographic Hash Functions
Hashing Algorithms in Blockchain
Digital Signature Algorithm
Public and Private Keys in Blockchain
Role of Cryptography in Blockchain
References
The Blockchain Foundation
Symmetric encryption uses the same Asymmetric encryption employs a Hashing algorithms convert data into
key for both encryption and pair of keys: a public key for a fixed-size string of characters,
decryption. It is efficient for encryption and a private key for which is unique to the input data.
encrypting large amounts of data but decryption. This method enhances They ensure data integrity and are
requires secure key management. security and is widely used for secure essential in creating blockchain
transactions. blocks.
Types of cryptography
• Broadly, there are two kinds of • Asymmetric Key Cryptography
cryptography:
• Symmetric key (a.k.a. private key) and
asymmetric key (a.k.a. public key)
cryptography
Symmetric Key Cryptography
Encryption
● Faster processing speed compared to asymmetric ● Key distribution can be problematic, as both
encryption due to the simpler algorithm structure. parties need to securely share the same key
beforehand.
● Ideal for encrypting large volumes of data, making
it suitable for applications requiring bulk data ● If the key is compromised, all data encrypted with
encryption. that key is vulnerable, posing a significant security
risk.
● Widely used in securing data at rest and in transit,
providing a robust level of confidentiality. ● Scalability issues arise in environments with many
users, as each user needs a unique key for secure
communication.
Cryptographic Hash Functions
• A cryptographic hash function is a one-
way function that converts input data of
arbitrary length and produces a fixed- • Hash function in its basic form
length output
• The output is usually termed “hash value”
or “message digest.”
• Input can be any string of any size, but the
output is of fixed length, say, a 256-bit
output or a 512-bit output as examples.
• It is deterministic, in the sense that the
same input when provided to the same
hash function produces the same hash
value every time.
• It is infeasible (though not impossible!) to
invert and generate the message from its
hash value, except trying for all possible
messages.
Cryptography
● Hashing algorithms are fundamental to blockchain technology, ensuring the integrity and
immutability of data stored in blocks.
● When data is added or altered, the hash of the block changes, signaling tampering and
invalidating the entire blockchain, which enhances security.
● Hashing algorithms also link blocks together; each block contains the hash of the previous
block, creating a secure chain that prevents unauthorized modifications.
● The use of hashing algorithms enables efficient verification of data integrity, as only the hash
needs to be checked to confirm that the block's content has not changed.
Digital Signature Algorithm (DSA)
• The DSA is a cryptographic algorithm used
for creating digital signatures.Its primary
objective is to sign messages digitally
• DSA provides the following security
properties:
• Authenticity: Signed by private key and
verified by public key
• Data integrity: Hashes will not match if the
data is altered.
• Non-repudiation: Since the sender signed it,
they cannot deny later that they did not send
the message. Non-repudiation is a property
that is most desirable in situations where
there are chances of a dispute over the
exchange of data. For example, once an order
is placed electronically, a purchaser cannot
deny the purchase order if non-repudiation is
enabled in such a situation
Security
● Public keys are cryptographic keys that can be shared openly and are used
to encrypt data or verify signatures.
● Private keys must be kept secret and are used to decrypt data or create
digital signatures, ensuring that only the owner can access or authorize
transactions.
● The combination of public and private keys creates a secure system where
only the holder of the private key can access and manage their blockchain
assets.
Cryptography
Ensuring Data Integrity ● Hashing algorithms create unique fingerprints for data, making it tamper-
evident.
● Any alteration in the transaction data changes its hash, signaling potential
fraud.