Encryption and Decryption
The aim of encryption is to ensure that only the party (HIU) that has been granted consent by the user (or patient) is able to access the health data information of the user.
Here’s a high level overview on how the process of encyption and decryption works between HIUs and the HIPs, with the consent of the patient:
- Every Health Information User (HIU) has 2 keys; that is public & private key.
- When the HIU wants to request any HIP for information, the public key of the HIU (along with other key material pertaining to the HIU and the corresponding request) is shared in the request.
- The HIP validates that the user/patient has granted consent to the HIP (requesting for data) to share health data information.
- Once that is validated, the HIP will encrypt the data using a shared key (which is generated using HIP’s private key, and HIU’s publick key material)
- The encrypted data is then shared with HIU, along with the public key of HIP (and other key material).
- HIUs will have to decrypt data using a shared key (which is generated using HIU’s private key, and HIP’s publick key material).
Here’s a sequence diagram to understand the how the flow and exchange of information takes place:
A detailed coverage on the implemetation principles can be found in this section.
Example Implementation(s)
The use of Fidelius CLI is encouraged for implementing encryption and decryption as a part of Milestone 2 and Milestone 3 (Building HIP and Building HIU) requirements.
Fidelius CLI’s usage is covered in detail in this section.
Following is a short video demonstrating Fidelius CLI’s usage in the context of a HIP.
This webinar (from 2:33:52) — also covers the usage of Fidelius CLI in detail, from both the HIP and HIU perspectives.
Using Fidelius CLI with other Programming Languages
While Fidelius CLI is a Java implementation, the ./examples
folder in the corresponding repository can be perused for guidance on integrating Fidelius CLI (achieved by invoking the binary as a subprocess) in Node JS, Python, Ruby, and PHP codebases.
The above examples can be run using the following commands:
$ node examples/node/index.js
$ python3 examples/python/main.py
$ ruby examples/ruby/main.rb
$ php examples/php/index.php