Giter Site home page Giter Site logo

fidelius's Introduction

Fidelius

What does it mean?

Derived form Fidelius Charm, a magic spell that can conceal secrets.

In the context of projectEka, this is a reference service that does the following

  • Generates key Parameters (Private key, Public key and nonce).
  • For HIP encrypt given data based on the key parameters passed and give public key in a format that can be shared with the HIU.
  • For HIU decrypt the data based on the key parameters passed

How to run

  • Clone repo git clone [email protected]:sukreet/fidelius.git
  • build jar ./gradlew clean build
  • Run application on port java -Dserver.port=8090 -jar build/libs/fidelius-0.0.1-SNAPSHOT.jar

Available APIs

API to generate key material

Request :

curl --location --request GET 'http://localhost:8090/keys/generate' \ --header 'Accept: application/json'

Response :

{ "privateKey": "CIcMqJzOE+CUpDbkp2WAwfatqppQqiP4q6yOYPYCeBo=", "publicKey": "BECzeFbSDRJTeedGinISJzPdSuC5ZTtniV+XNXAFIwtnNukNnQWcKVOKhJiiGtJc3bfKGXhWOqQZVyQlsSUv8WA=", "nonce": "tBZ0wkJEQJ0rRmkCGF3Utr/ASwydkoGMfUhhl8Nj9r4=" }

API to Encrypt data (for HIP)

Request :

curl --location --request POST 'http://localhost:8090/encrypt' \ --header 'Content-Type: application/json' \ --data-raw '{ "receiverPublicKey": "Public key received as a part of data transfer request", "receiverNonce": "Nonce received as a part of data transfer request", "senderPrivateKey": "Private key generated by sender (HIP) using /keys/generate", "senderPublicKey": "Public key generated by sender (HIP) using /keys/generate", "senderNonce": "Nonce key generated by sender (HIP) using /keys/generate", "plainTextData": "valid fhir document" }'

Response :

{ "encryptedData": "encrypted FHIR document", "keyToShare": "Public key that needs to be shared with HIU along with encrypeted data" }

API to decrypt data (for HIU)

Request :

curl --location --request POST 'http://localhost:8090/decrypt' \ --header 'Content-Type: application/json' \ --data-raw '{ "receiverPrivateKey": "Private key corresponding to the public that was shared whith HIP as part of data request", "receiverNonce": "Nonce that was shared with HIP as part of data request", "senderPublicKey": "public key received from HIP along encrypeted data", "senderNonce": "nonce received from HIP along encrypeted data", "encryptedData": "encrypted FHIR document" }'

Response :

{ "decryptedData": "FHIR document" }

fidelius's People

Contributors

sukreet avatar sidharthramesh avatar shobhit99 avatar

Stargazers

Poornachandra 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.