このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Blockchain Service/ Developer Guide/ Appendix/ Homomorphic Encryption/ Using the Homomorphic Encryption Library

Using the Homomorphic Encryption Library

Updated on 2023-01-16 GMT+08:00

This section describes how to use the homomorphic encryption library.

Procedure

  1. Buy a BCS instance and downloading files.

    When buying a BCS instance, select ECDSA for Security Mechanism. After the subscription, download the homomorphic encryption library ahex.x.x.tar.gz, OSCCA-published cryptographic algorithm SDK sdkx.x.x.tar.gz in the client development kit, and the user certificates and configuration files of peers and orderers.

  2. Installing the client SDK library.

    Decompress the downloaded OSSCA-published cryptographic algorithm SDK sdkx.x.x.tar.gz to the $GOPATH directory.

  3. Install the homomorphic encryption library.

    Decompress the downloaded homomorphic encryption library ahex.x.x.tar.gz to the $GOPATH directory.

  4. Install the dependent library (only for Fabric v1.1).

    The dependent library files are stored in the homomorphic encryption library directory. The decompressed homomorphic encryption library file is stored in the $GOPATH/src/ahe/PSW/deps/lib directory. Copy all the files in this directory to the local /usr/local/include/openssl/ directory. (If this directory does not exist, create it.) Then, run the following command to set the environment variables:

    export LD_LIBRARY_PATH=/usr/local/include/openssl:$LD_LIBRARY_PATH 
    //The project path /usr/local/include/openssl is used as an example. Replace it with the actual directory, if any.
    NOTE:

    If the system displays a message indicating that libgmp is missing, install the gmp library. For details about the installation method, see the Linux operating system package management tool. For example, if Ubuntu is used, run the apt-get install libgmp10 command to install the library, or download the source code from https://gmplib.org/, then compile and install the library.

  5. Develop the client program and chaincode.

    Refer to the AHE Lib APIs and Chaincode Library APIs to develop the application and chaincode (smart contract).

    For example, the logic of an app client and chaincode is as follows:

    • Typical service logic of an app client:
      1. Register a user.

        When a user is registered, the key generation function can be invoked to generate public and private keys for the user.

      2. Initialize the account balance.

        When the balance is initialized, the initial balance preparation function can be invoked to generate initial balance data with privacy protected.

      3. Initiate a transaction.

        During a transaction, the transaction preparation function can be invoked to generate transaction data with privacy protected.

    • Typical service logic of a chaincode:
      1. Store the mapping between the user's public key and address.
      2. Verify the validity of the initial balance and generate an initial transaction.
      3. Verify the validity of transaction data and generate the transaction result.
        NOTE:
        • The chaincode can invoke the initial balance verification function to verify the validity of the initial balance.
        • The transaction verification function is invoked to verify the validity of transaction data.

  6. Install a chaincode.

    Install and instantiate the developed chaincode for the subscribed BCS instance on the management page.

  7. Deploy the application.

    When developing the application, you can invoke the homomorphic encryption library to protect the transaction privacy. After the development is completed, deploy the application on the purchased server. After deployment, ensure that the configuration files, certificate files (user certificates of peers and orderers), and openssl library are available in the environment.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback