{"action":"created","issue":{"url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/220","labels_url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/220/comments","events_url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/220/events","html_url":"https://github.com/HospitalRun/hospitalrun-frontend/issues/220","id":120566211,"number":220,"title":"Encryption for patient data","user":{"login":"pengux","id":2286687,"avatar_url":"https://avatars.githubusercontent.com/u/2286687?v=3","gravatar_id":"","url":"https://api.github.com/users/pengux","html_url":"https://github.com/pengux","followers_url":"https://api.github.com/users/pengux/followers","following_url":"https://api.github.com/users/pengux/following{/other_user}","gists_url":"https://api.github.com/users/pengux/gists{/gist_id}","starred_url":"https://api.github.com/users/pengux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengux/subscriptions","organizations_url":"https://api.github.com/users/pengux/orgs","repos_url":"https://api.github.com/users/pengux/repos","events_url":"https://api.github.com/users/pengux/events{/privacy}","received_events_url":"https://api.github.com/users/pengux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-12-05T15:32:52Z","updated_at":"2015-12-06T16:01:08Z","closed_at":null,"body":"Is there any encryption for the patient data? If there is, it should be documented"},"comment":{"url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/comments/162325269","html_url":"https://github.com/HospitalRun/hospitalrun-frontend/issues/220#issuecomment-162325269","issue_url":"https://api.github.com/repos/HospitalRun/hospitalrun-frontend/issues/220","id":162325269,"user":{"login":"hex007","id":1689246,"avatar_url":"https://avatars.githubusercontent.com/u/1689246?v=3","gravatar_id":"","url":"https://api.github.com/users/hex007","html_url":"https://github.com/hex007","followers_url":"https://api.github.com/users/hex007/followers","following_url":"https://api.github.com/users/hex007/following{/other_user}","gists_url":"https://api.github.com/users/hex007/gists{/gist_id}","starred_url":"https://api.github.com/users/hex007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hex007/subscriptions","organizations_url":"https://api.github.com/users/hex007/orgs","repos_url":"https://api.github.com/users/hex007/repos","events_url":"https://api.github.com/users/hex007/events{/privacy}","received_events_url":"https://api.github.com/users/hex007/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T16:01:08Z","updated_at":"2015-12-06T16:01:08Z","body":"This is my workflow towards the encryption problem.\n\n1) A user logs into the system.\n1.1) The username password and a random hash token (encryption token) is generated.\n1.2) the server recieves this data.\n1.3) the server authenticates the user and generates an access token. This is used for all further communications.\n1.4) the user successfully authenticated message is sent to client with access token\n\n2) A user makes a data request\n2.1) the data request is received by the server \n2.2) the user is authenticated based on request token and user access to data is verified \n2.2) the response is encrypted with the token sent by the user while logging in (step 1.1)\n2.3) the user recieves the response \n2.4) response is stored locally for current and later use\n2.5) response is decrypted and accessible to user\n\n3) The user leaves the station by locking the system\n3.1) all user data is encrypted\n3.2) the user tokens are locked in a local crypto storage.\n3.3) the tokens are forgotten by the browser\n\n4) the user comes back to the station to resume work\n4.1) the user logs in again but since records show that user is already logged into the server local crypto storage is accessed using credentials to unlock access token and encryption token.\n4.2) all user data is decrypted using encryption token\n4.3) the data is synchronized to check for updates\n4.4) the data is available to the user\n4.5) all new requests are made with the access token\n\n5) the user logged out\n5.1) when the user logs out the data is errased unless offline mode is active.\n5.2) users access token is sent to server for deauthenication\n5.3) his encryption key is deleted unless offline mode is active\n5.4) the user successfully logged out\n"}}