{ "info": { "author": "NashMiao", "author_email": "wdx7266@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Ontology DDXF Cryptography Components\n\nEnglish | [\u4e2d\u6587](README_CN.md)\n\n\n\n- [1. Ontology Distributed Identity Framework (ONT ID)](#1-ontology-distributed-identity-framework-ont-id)\n- [2. Encryption Service Based on ONT ID](#2-encryption-service-based-on-ont-id)\n - [2.1. Encryption Process](#21-encryption-process)\n - [2.2. Decryption Process](#22-decryption-process)\n- [3. Password-Based Key Derivation Function (PBKDF)](#3-password-based-key-derivation-function-pbkdf)\n- [4. Elliptic Curve Integrated Encryption Scheme (ECIES)](#4-elliptic-curve-integrated-encryption-scheme-ecies)\n\n\n\n## 1. Ontology Distributed Identity Framework (ONT ID)\n\nOntology 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.\n\nIf you are interested in ONT ID, you can find a detailed introduction [here](https://ontio.github.io/documentation/ontology_DID_en.html).\n\n
\n\n## 2. Encryption Service Based on ONT ID\n\n### 2.1. Encryption Process\n\nThere are three main steps to encrypting data:\n\n- Query public key: Access the smart contract in the ontology blockchain and get the corresponding public key `pk` based on the data requester's `ONT ID`.\n- Random sampling: Randomly sample 256-bit data to obtain the Advanced Encryption Standard (AES) key `key`.\n- Encryption: The AES256 key is encrypted using the Public Key Encryption Algorithm (PKE) to get `ekey`, and the plaintext data `m` is encrypted using AES256-GCM to get the ciphertext data `c`.\n\n
\n\n### 2.2. Decryption Process\n\n- Query private key: Find the corresponding private key `sk` from the private key management module according to `ONT ID` and `PKIndex`.\n- Decrypt symmetric key: Use the private key `sk` to decrypt the encrypted key `ekey` to get the AES symmetric key `key`.\n- Decrypt data: Use the AES symmetric key `key` to decrypt the ciphertext data `c` to get the plaintext data `m`.\n\n## 3. Password-Based Key Derivation Function (PBKDF)\n\nIn 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.\n\nIn Distributed Data eXchange Framework(short for DDXF), the hash function used by the key derivation algorithm is `SHA256`, and algorithm is as follows:\n\n- Input: `seed`, derived key length `dkLen` (in bits).\n- Output: Derived key `key` of length `dklen`.\n\n```python\ndef pbkdf2(seed: str or bytes, dk_len: int) -> bytes:\n key = b''\n index = 1\n bytes_seed = str_to_bytes(seed)\n while len(key) < dk_len:\n key += sha256(b''.join([bytes_seed, int_to_little_bytes(index)]))\n index += 1\n return key[:dk_len]\n```\n\n## 4. Elliptic Curve Integrated Encryption Scheme (ECIES)\n\nElliptic 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](https://www.shoup.net/papers/iso-2_1.pdf).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/NashMiao/ontology-ddxf-crypto", "keywords": "", "license": "GNU Lesser General Public License v3 (LGPLv3)", "maintainer": "NashMiao", "maintainer_email": "wdx7266@outlook.com", "name": "ontology-ddxf-crypto", "package_url": "https://pypi.org/project/ontology-ddxf-crypto/", "platform": "", "project_url": "https://pypi.org/project/ontology-ddxf-crypto/", "project_urls": { "Homepage": "https://github.com/NashMiao/ontology-ddxf-crypto" }, "release_url": "https://pypi.org/project/ontology-ddxf-crypto/0.0.2/", "requires_dist": [ "ecdsa", "pycryptodomex", "ontology-python-sdk" ], "requires_python": ">=3.5,<4", "summary": "Ontology DDXF Cryptography Components", "version": "0.0.2" }, "last_serial": 4489084, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "aaa193b9ac4950b04cc38c1b807ee9d0", "sha256": "e66ecaca3ddf4ecb5f2b7f546d06c4fb6880aae17643bad5d65a513501f85548" }, "downloads": -1, "filename": "ontology_ddxf_crypto-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "aaa193b9ac4950b04cc38c1b807ee9d0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 9787, "upload_time": "2018-11-15T09:42:04", "url": "https://files.pythonhosted.org/packages/6e/34/5f430a6e21838dea4ccfd4ba87a3dc360f2eccb16a9e4519d896c2efa0e7/ontology_ddxf_crypto-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5015f876dcec17b17fdc2e2a035362ac", "sha256": "c5c77cb6c75fd3fef2da26157765024c66554cccfbcee09ec33787a135951024" }, "downloads": -1, "filename": "ontology_ddxf_crypto-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5015f876dcec17b17fdc2e2a035362ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 9920, "upload_time": "2018-11-15T09:47:34", "url": "https://files.pythonhosted.org/packages/16/81/566c587fa11bbbb267ed403a73739a2b4d9a7efb64af3e322b9925e19a2e/ontology_ddxf_crypto-0.0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5015f876dcec17b17fdc2e2a035362ac", "sha256": "c5c77cb6c75fd3fef2da26157765024c66554cccfbcee09ec33787a135951024" }, "downloads": -1, "filename": "ontology_ddxf_crypto-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5015f876dcec17b17fdc2e2a035362ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4", "size": 9920, "upload_time": "2018-11-15T09:47:34", "url": "https://files.pythonhosted.org/packages/16/81/566c587fa11bbbb267ed403a73739a2b4d9a7efb64af3e322b9925e19a2e/ontology_ddxf_crypto-0.0.2-py3-none-any.whl" } ] }