Skip to main content

sgx storage client

Project description

SGX Storage Client

A secure Python client for Intel SGX enclave communication implementing DCAP remote attestation and AES-GCM encrypted sessions. Designed for managing sensitive configurations in trusted execution environments.

Features

  • Secure Session Protocol - Ephemeral ECDH key exchange + AES-128-GCM encryption
  • DCAP Remote Attestation - Verify enclave identity through Intel's Quote Verification Service
  • Complete Management API:
    • Exchange account credentials storage
    • Blockchain address whitelisting
    • Multi-role user access control
    • Network/currency configuration management
  • Production-Ready Security:
    • MRSIGNER-based enclave verification
    • Anti-replay protection with session nonce
    • CMAC-based key derivation (NIST SP 800-108)
    • Hardware-rooted trust chain

Installation

pip install sgx-storage-client

Components

  • SGX Client (client.py)

    Main interface for enclave communication:

from sgx.client import SgxClient
from sgx.attestaion import SGXAttestationVerifier

client = SgxClient(
    host="enclave.example.com",
    port=2241,
    spid="11223344556677889900AABBCCDDEEFF",  # 16-byte hex Service Provider ID
    private_value=680592519268687832738673940181144757182820103, # Private key for enclave authentication
    attestation_verifier=SGXAttestationVerifier(
        mr_signer="a1b2c3d4e5f6...", # Trusted enclave fingerprint
        dcap_url="https://qvs.example.com/qvs/attestation/sgx/dcap/v1/report"
    )  # Optional, use None to skip dcap verification
)
  • Attestation Module (attestation.py)

    Interface for enclave attestation:

from sgx.attestaion import SGXAttestationVerifier

verifier = SGXAttestationVerifier(
    mr_signer="trusted_enclave_hash",
    dcap_url="https://qvs.example.com/qvs/attestation/sgx/dcap/v1/report"
)
  • Session Handler (session.py)

    Manages secure channel:

    • Automatic attestation protocol (MSG0-MSG4)
    • Session key derivation
    • Encrypted payload handling

Example usage

Exchange Account Management

client.get_accounts()

client.add_account(
   name='main-account', 
   exchange='binance', 
   public_key='public-key',
   key='sercret-key', 
   sorting_key=1, 
   additional_data={}
)

client.update_account(
   account_id='1binance', 
   name='secondary-account', 
   public_key='public-key', 
   key='secret-key', 
   sorting_key=1, 
   additional_data={}
)

client.del_account('1binance')

Address Management

client.get_standalone_addresses()

client.add_standalone(
    address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF',
    network='ETHEREUM',
    alias='eth-address',
    whitelist=True,
    multisig=False,
    currencies=['ETH', 'USDT'],
    sorting_key=1
)

client.update_standalone(
    address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF',
    network='ETHEREUM',
    alias='eth-address-2',
    whitelist=True,
    multisig=False,
    currencies=[],
    sorting_key=1
)

client.del_standalone(address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF', network='ETHEREUM')

Whitelist Management

client.get_whitelist()

client.add_whitelist(
    address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF',
    network='ETHEREUM',
    alias='trusted-address',
    currencies=[],
    sorting_key=1
)

client.update_whitelist(
   address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF',
   network='ETHEREUM',
   alias='trusted-address-2'
)

client.del_whitelist(
    address='0xC8CD2BE653759aed7B0996315821AAe71e1FEAdF',
    network='ETHEREUM',
)

User Management

client.get_users()

client.add_user(
    user='test@gamil.com', 
    role='FULL_ACCESS', 
    sorting_key=2
)

client.update_user(user='test@gamil.com', role='READ_ONLY', sorting_key=2)

client.del_user('test@gamil.com')

client.reset_user_hotp('test@gamil.com')

configurations

client.get_network_coins()

client.get_status()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgx_storage_client-0.0.3.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgx_storage_client-0.0.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file sgx_storage_client-0.0.3.tar.gz.

File metadata

  • Download URL: sgx_storage_client-0.0.3.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for sgx_storage_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1f22aa327d349abf4a7913337ba50289e1e2f827d8a1837ed4c7ad71ec5270c8
MD5 10de13735e7f00046717d9a274af980d
BLAKE2b-256 93acb4fc3640af143d003e4d0ed2efb44b16baf8002cfa23faf48be36835aa8f

See more details on using hashes here.

File details

Details for the file sgx_storage_client-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sgx_storage_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b76ccfbfb00d72c77ec29291782816b8805290d869b283a8498a2d61dc7b0eb3
MD5 da7dc245c35c5adaf741dca2126ca5c8
BLAKE2b-256 403c5780abb36790acb8e2e13189476aceb7637a3784bea07838fecf790db8a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page