Ontology DDXF Cryptography Components
Project description
Ontology DDXF Cryptography Components
English | 中文
- 1. Ontology Distributed Identity Framework (ONT ID)
- 2. Encryption Service Based on ONT ID
- 3. Password-Based Key Derivation Function (PBKDF)
- 4. Elliptic Curve Integrated Encryption Scheme (ECIES)
1. Ontology Distributed Identity Framework (ONT ID)
Ontology DID (also called ONT ID) is a decentralized identity identification protocol based on W3C DID specifications. ONT ID establishes a cryptographically-based digital identity for each entity, allowing self-sovereign of data authorization and ownership confirmation, which makes the identity and data truly assets that the user can control.
If you are interested in ONT ID, you can find a detailed introduction here.
2. Encryption Service Based on ONT ID
2.1. Encryption Process
There are three main steps to encrypting data:
- Query public key: Access the smart contract in the ontology blockchain and get the corresponding public key
pkbased on the data requester'sONT ID. - Random sampling: Randomly sample 256-bit data to obtain the Advanced Encryption Standard (AES) key
key. - Encryption: The AES256 key is encrypted using the Public Key Encryption Algorithm (PKE) to get
ekey, and the plaintext datamis encrypted using AES256-GCM to get the ciphertext datac.
2.2. Decryption Process
- Query private key: Find the corresponding private key
skfrom the private key management module according toONT IDandPKIndex. - Decrypt symmetric key: Use the private key
skto decrypt the encrypted keyekeyto get the AES symmetric keykey. - Decrypt data: Use the AES symmetric key
keyto decrypt the ciphertext datacto get the plaintext datam.
3. Password-Based Key Derivation Function (PBKDF)
In cryptography, PBKDF (Password-Based Key Derivation Function) is key derivation functions with a sliding computational cost, aimed to reduce the vulnerability of encrypted keys to brute force attacks.
In Distributed Data eXchange Framework(short for DDXF), the hash function used by the key derivation algorithm is SHA256, and algorithm is as follows:
- Input:
seed, derived key lengthdkLen(in bits). - Output: Derived key
keyof lengthdklen.
def pbkdf2(seed: str or bytes, dk_len: int) -> bytes:
key = b''
index = 1
bytes_seed = str_to_bytes(seed)
while len(key) < dk_len:
key += sha256(b''.join([bytes_seed, int_to_little_bytes(index)]))
index += 1
return key[:dk_len]
4. Elliptic Curve Integrated Encryption Scheme (ECIES)
Elliptic Curve Integrated Encryption Scheme(also ECIES), is a hybrid encryption system proposed by Victor Shoup in 2001. Shoup's submission can be found at here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ontology_ddxf_crypto-0.0.2-py3-none-any.whl.
File metadata
- Download URL: ontology_ddxf_crypto-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5c77cb6c75fd3fef2da26157765024c66554cccfbcee09ec33787a135951024
|
|
| MD5 |
5015f876dcec17b17fdc2e2a035362ac
|
|
| BLAKE2b-256 |
1681566c587fa11bbbb267ed403a73739a2b4d9a7efb64af3e322b9925e19a2e
|