GithubHelp home page GithubHelp logo

isabella232 / secured-saas-wallet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure/secured-saas-wallet

0.0 0.0 0.0 989 KB

Core modules for SaaS crypto-currency virtual wallet

License: MIT License

C# 82.48% PowerShell 17.06% CSS 0.43% JavaScript 0.02%

secured-saas-wallet's Introduction

Core modules for crypto-currency virtual wallet Build Status

The project consists of the infrastructure Core modules needed for implementing a SaaS cryptocurrency virtual wallet. This project has the following modules:

Secrets manager for the communication pipeline

For abstracting the needed secrets for the encryption/signing operations over the sent messages

A secure communication library over a queue

For inter micro-services communication

An Ethereum node client

For querying, signing and sending transactions and data over the public (and test) Ethereum network

This project also contains a Sample directory, to get you started.

Installation

The project contains three components:

  1. Blockchain - Blockchain (Currently only Ethereum implementation) related functionality
  2. Communication - Communication pipeline between micro-services.
  3. Cryptography - Provides functionality for saving the users secrets (private keys) and for securing the micro-services communication pipeline

To consume, clone the repository and add the projects as dependencies.

Usage examples:

Secrets Manager

// Create
var kv = new KeyVault(...);

var secretsMgmnt =
                new KeyVaultCryptoActions(
                    new CertificateInfo(encryptionKeyName, encryptionCertPassword),
                    new CertificateInfo(decryptionKeyName, decryptionCertPassword),
                    new CertificateInfo(signKeyName, signCertPassword),
                    new CertificateInfo(verifyKeyName, verifyCertPassword),
                    kv,
                    kv);

// Initialize
await secretsMgmnt.InitializeAsync();

// Call methods
var rawData = "Some text";
var encryptedData = secretsMgmnt.Encrypt(Communication.Utils.ToByteArray(rawData));
var originalData = secretsMgmnt.Decrypt(encryptedData);

Communication pipeline

// The following code enqueues a message to a queue named 'MyQueue'
var secretsMgmnt = new KeyVaultCryptoActions(...);
secretsMgmnt.InitializeAsync().Wait();

var queueClient = new CloudQueueClientWrapper(ConfigurationManager.AppSettings["AzureStorageConnectionString"]);
// Create
var securedComm = new AzureQueue("MyQueue", queueClient, secretsMgmnt, true);
// Init
await securedComm.InitializeAsync();

// Enqueue messages
await securedComm.EnqueueAsync(Communication.Utils.ToByteArray("A message"));

 securedComm.DequeueAsync(
   msg =>
   {
      Console.WriteLine("Decrypted and Verified message is" : + msg);
   });
  

Ethereum node client

// Create the instance of the Sql connector (which holds the users' private keys)
var sqlDb = new SqlConnector(...);
// Create the instance
var ethereumNodeClient = new EthereumAccount(sqlDb, ConfigurationManager.AppSettings["EthereumNodeUrl"]);

// Call methods
var result = await ethereumNodeClient.GetPublicAddressAsync("0x012345...");

Sample

Sample wallet app that uses the provided libraries can be found here

Known Issues

  • Getting 'access denied' when the script trys to set a new secret into KeyVault: wrong object id was entered. refer to the pre-requisites step and make sure you are using the correct object id.

Contributing

See instructions here.
By participating in this project, you agree to abide by the Microsoft Open Source Code of Conduct

secured-saas-wallet's People

Contributors

amiturgman avatar eladiw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.