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.2.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.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sgx_storage_client-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 53c8789ef5b10768a72c37cfa16e626b60398cc292ff4cfd429103bf0ae5cc1f
MD5 050e20ff4485696a55eb6636db5adcfb
BLAKE2b-256 5af7fd9b588f258be4338abfd8c66599ea9fd02ca42f5acfc1aafa977d03690a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sgx_storage_client-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f81896e1d3dbe26632e7e939ddddef9be343b2ad3f57ff3f902a848949050014
MD5 376ca938ff4ce79fb5c00c9a4d0b776e
BLAKE2b-256 c9cd10960b6716ee9518f80fe30672d45f6ae8818f4625f251bdd4178550bdd5

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