Skip to content

CodeMachine0121/EccSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EccSDK

  • EccSDK is a library that provides a simple way to interact with Chameleon Hash based on the ECC API.
  • You can search this package in this nuget page

Usage for 1.1.*

  • add EccGenerator to generate key pair and stored into a file
  • add KeyPairDomain model to handle key pair and session key
var keyPairDomain = EccGenerator.GetKeyDomain();

var chameleonHashService = new ChameleonHashService(keyPairDomain);

var chameleonSignature = chameleonHashService.Sign("Hello world");

chameleonHashService.Verify(new ChameleonHashVerifyRequest()
{
    KeyPairDomain = keyPairDomain,
    Message = "Hello world",
    StrSignature = chameleonSignature.Value
});

Usage for 1.0.*

var keyPair = EccKeyPair.GenerateKeyPair();

var signature = ChameleonHashHelper.Sign(new ChameleonHashRequest
{
    KeyPair = _keyPair,
    Message = "Hello World",
    Order = keyPair.PublicKey.Curve.Order,
    SessionKey = new BigInteger("1234567890")
});

var chameleonHash = ChameleonHashHelper.GetChameleonHash(new ChameleonHashRequest
{
    KeyPair = _keyPair,
    Message = "Hello World",
    Order = keyPair.PublicKey.Curve.Order,
    SessionKey = new BigInteger("1234567890"),
    Signature = sign
});

var result = ChameleonHashHelper.Verify(new ChameleonHashRequest
{
    KeyPair = _keyPair,
    Message = "Hello World",
    Order = keyPair.PublicKey.Curve.Order,
    Signature = sign
}, chameleonHash);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages