🎰Encryption
AES Encryption Standard
Advanced Encryption Standard (AES) is a widely used symmetric encryption algorithm. It operates on fixed-size blocks of data (128-bit blocks) and supports key sizes of 128, 192, or 256 bits. AES is highly efficient and secure, making it a popular choice for encrypting sensitive data.
Key Features:
Symmetric Encryption: Both encryption and decryption use the same key.
Block Cipher: AES encrypts data in blocks of 128 bits.
Operating Modes: AES supports several modes like CBC (Cipher Block Chaining), GCM (Galois/Counter Mode), etc., for flexibility in different applications.
Security: AES-256 provides a high level of security due to its large key size.
Your AES Implementation:
The provided code uses AES-256-CBC, where:
Key (256 bits): Used for both encryption and decryption.
Initialization Vector (IV): A random value to ensure unique ciphertexts for identical plaintexts.
Encryption Process:
Input text is converted to bytes.
Encrypted using the cipher initialized with the key and IV.
Outputs the encrypted data and IV as hexadecimal strings.
Decryption Process:
Uses the encrypted data and IV to reconstruct the original plaintext.
AES Code Example:
This AES encryption is applied to secure cost functions within your network.
Pedersen Commitments
The Pedersen Commitment scheme is a cryptographic protocol that allows a value to be "committed" while keeping it hidden. It is widely used in privacy-preserving systems due to its binding and hiding properties.
Properties:
Binding: Once committed, the value cannot be changed without invalidating the commitment.
Hiding: The committed value remains hidden until explicitly revealed.
Homomorphic: Commitments can be added together to produce a commitment to the sum of their values.
How It Works:
Setup:
Two large prime numbers ppp and qqq are generated, where q∣(p−1)q \mid (p-1)q∣(p−1).
Two group elements ggg and hhh are chosen such that g,h∈Zq∗g, h \
Commitment: A value xxx is committed using: C=gx⋅hrmod qC = g^x \cdot h^r \mod qC=gx⋅hrmodq where rrr is a random value.
Verification: To verify, the commitment CCC is checked against the disclosed xxx and rrr.
Your Pedersen Commitment Implementation:
Generates large primes ppp and qqq.
Randomly selects ggg, sss, and computes h=gsmod qh = g^s \mod qh=gsmodq.
Provides functions for committing, verifying, and adding commitments.
Code Implementation:
System Overview
Byzantine Fault Tolerance:
The system employs Pedersen commitments to ensure that all nodes in the network agree on cost functions securely:
Commitments: Each node commits to a cost using Pedersen commitments.
Encryption: Cost values are encrypted using AES before aggregation.
Aggregation: Committed values are aggregated to ensure correctness.
Verification: Results can be verified to ensure Byzantine fault tolerance.
Last updated