canine-docs/docs/protocol/encryption.md

46 lines
2.3 KiB
Markdown
Raw Normal View History

2022-09-01 21:51:23 +00:00
---
sidebar_position: 2
---
2023-04-28 20:22:08 +00:00
# Encryption in Jackal Protocol
2022-09-01 21:51:23 +00:00
The Jackal Protocol utilizes encryption techniques to ensure the privacy and security of user data. The two primary
encryption models within the protocol are file encryption and file-entry encryption. File encryption secures the files
themselves, while file-entry encryption focuses on securing the file entries on the blockchain.
2022-09-01 21:51:23 +00:00
2023-04-28 20:22:08 +00:00
## File Encryption
2022-09-01 21:51:23 +00:00
File encryption is essential for protecting the data stored on storage providers within the Jackal Protocol. Before
transferring files to storage providers, the user's client encrypts the files using a randomly generated symmetric key.
The Advanced Encryption Standard (AES-256) is used for this encryption process, resulting in a securely encrypted file.
2022-09-01 21:51:23 +00:00
2023-04-28 20:22:08 +00:00
![File Encryption Process](/img/jkl_paper/enc1.png)
2022-09-01 21:51:23 +00:00
The symmetric key's secure storage is equally crucial, as exposing it would compromise the file's encryption. The Jackal
Chain's File Tree Module serves as a safe and immutable location for storing the encrypted symmetric key alongside the
file's location.
2022-09-01 21:51:23 +00:00
2023-04-28 20:22:08 +00:00
## Integrated Encryption Scheme
2022-09-01 21:51:23 +00:00
The protocol uses an Integrated Encryption Scheme based on AES and the Elliptic Curve cryptography, which generates
Bech32 addresses for secure key storage.
2023-04-28 20:22:08 +00:00
![Integrated Encryption Scheme](/img/jkl_paper/enc2.png)
To securely store the symmetric key, the protocol encrypts it with the user's public key. This process ensures that only
the user with the corresponding private key can decrypt the symmetric key.
2023-04-28 20:22:08 +00:00
![Symmetric Key Decryption](/img/jkl_paper/enc3.png)
When decrypting a file, the user's private key is used to decrypt the symmetric key. Once the symmetric key is
retrieved, it can be used to decrypt the file stored on the storage provider, resulting in the original uploaded file.
2023-04-28 20:22:08 +00:00
## File Sharing and Access
To share files with other users, the protocol first decrypts the symmetric key from the chain, then retrieves the
external user's public key from the chain, and encrypts the symmetric key with the external user's public key. By
appending the newly encrypted symmetric key to the file entry, the external user gains access to the file.
2023-04-28 20:22:08 +00:00
By leveraging encryption techniques for both files and file entries, the Jackal Protocol ensures the privacy, security,
and integrity of user data throughout the storage and sharing processes.