Before getting in ZK proofs, lets see some more primitives. Encryption is essential and historically the starting point of cryptography, so lets see what is encryption is about.
Encryption is a technique used to encode data, making it readable only to those who possess the correct decryption key. There are two main types of encryption - symmetric and asymmetric, each serving different purposes and with their own strengths and weaknesses.
Symmetric Encryption - Also known as single-key encryption, this method involves using the same key for both encryption and decryption. The most widely used symmetric encryption algorithm is Advanced Encryption Standard (AES).
Asymmetric Encryption - Also known as public-key encryption, this method uses a pair of keys: one for encryption and another for decryption. The RSA algorithm is one of the best known public-key algorithms.
-
Discrete Log Problem (DLP): This is a cornerstone problem in public-key cryptography and underlies many key exchange and encryption algorithms. Understanding DLP provides a foundation for the remaining topics.
-
Diffie-Hellman Key Exchange: This is one of the earliest practical implementations of key exchange protocols based on the Discrete Log Problem. It's critical to understand how secure communication can be established over insecure channels.
This protocol is significant as it enables secure communication over insecure channels by allowing two parties to generate a shared secret key, which can then be used for encryption and decryption of messages
For a deeper mathematical understanding, you can check Hoffstein's Book Chapters 2, 6-6.5
A hash function takes an input and returns a fixed-size string of bytes. SHA-256 and Poseidon are popular cryptographic hash functions in our context, with Poseidon specifically designed for arithmetic-friendly operations, benefiting certain applications in blockchains.
The primary characteristics of a good hash function are preimage resistance, second preimage resistance, and collision resistance, ensuring data security and integrity. In blockchain technology, hash functions create an unalterable, unique representation of each block's content, contributing to the immutability and transparency of the system.
Explore these resources to further your understanding:
- What Is SHA-256 Algorithm & How It Works
- How is SHA-256 used in blockchain, and why?
- Hash Function by Serious Cryptography Chapter 6
Merkle Trees are very essential on Mina Protocol, most of the people use that beautiful tool for their smart contracts and zkApps. We ask for a little bit more patience about all this theoretical parts - soon you will be using this Merkle Trees too!
Digital signatures ensure the integrity and authenticity of digital messages or documents. By providing a means to verify the origin and confirm that the content has not been altered, digital signatures play a pivotal role in maintaining trust in digital communications.
In Public Key Cryptography, anyone can encrypt their message with receiver's public key, which can be decrypted by the reciever's priate key only. Besides that, signer can generate a signature for a message using their private key, which can be used to validate that message is from some specific public key (sender, in this case).
In Public Key Cryptography, anyone can encrypt their message with the receiver's public key, and only the receiver can decrypt the message with their private key. In digital signatures, on the other hand, if a signer generates a signature for a message using their private key, anyone can validate it using the signer's public key. Therefore, the message of the signature is made public, which distinguishes it from cryptographic commitments.
Besides that, Mina protocol uses Schnorr signatures, which are known for simplicity and efficiency: