Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of UserID ownership using public key cryptography #2118

Closed
grctest opened this issue Sep 13, 2017 · 8 comments
Closed

Proof of UserID ownership using public key cryptography #2118

grctest opened this issue Sep 13, 2017 · 8 comments

Comments

@grctest
Copy link
Contributor

grctest commented Sep 13, 2017

Transparency/Background

  • Original 'project-rain' cryptocurrency field issue: The PR was rejected in accordance with the PMC's policies against the explicit inclusion of (and reference to) virtual currency related code within the core BOINC repo (still possible on an individual project basis).
  • Single user-data field: A scaled back version of 'project-rain' with no explicit reference to virtualcurrencies (implied use, not explicit intended use). Several legitimate risks to BOINC projects were identified during the 2017 workshop, such as painting a massive target on BOINC projects (externally/internally) to hackers monetarily motivated (since projects would have been storing the data being scraped by 3rd party systems).

Purpose

To prove within any external system that you are the owner of an UserID for an individual BOINC project, without storing external system data within the BOINC project's servers.

Github links

Proposed steps within BOINC

  • Introduce an additional openssl public/private key pair for this feature, keeping the existing keys separate and safe. Storing the public key in a scrape-able location (perhaps alongside the stats dumps).
  • Introduce a link to the user's profile, taking them to a separate php page for generating the signed message.
  • Within the new page there would be:
    • Some explanation text.
    • An input textbox (external system data for full handshake).
    • A button for executing the message signing function.
    • An output textbox where the output data will temporarily be displayed.
  • The message signing function will:
    • Require:
      • A minimum RAC before enabling the function - reducing the ease of claiming idle account ownership.
      • A verified email account (unless the project doesn't use email verification).
    • Use:
      • openssl_sign to sign the message "$UserID $External_System_Key"
      • External_system_key to provide full handshake, preventing extraction of master UserID from one network for replay on another.
    • Limit the length and accepted characters for $External_System_Key.
    • Potentially be limited to once an hour, if computationally expensive.
      • Downside being the requirement for an additional SQL table.
    • Output the signature and original message to the in-page output textbox. It will not store this data on the BOINC server (message is temporary).

Proposed use within external system

Pre-req: External system downloads the public-keys (used solely for this function, not the existing keys) from each of the involved projects.

  • User manually inputs their UserID signatures generated within each individual BOINC project.
    • If OAuth2 is implemented, streamline this process to improve user experience.
  • Broadcast registration transactions for for each project, including the generated encrypted messages.
  • Peers upon receiving the registration transaction:
    • Attempt to verify the signed message (contained within broadcast registration transaction) with the appropriate project public key.
      • If successful:
        • Attempt to verify that the contained $External_System_Key matches the user's beacon key (perform same check for UserID).
          • If keys & Ids match: Approve ownership of UserID.
          • Else: Reject ownership of UserID.
      • If unsuccessful:
        • Reject ownership of UserID.

Advantages over a single user-data field

It's more difficult for an attacker to claim external system rewards if a MinRAC and Email Verification is required. Offsets the risk of account compromise on a large scale for the purpose of claiming rewards (concern raised within the workshop).

If a project wishes to cut off external systems from rewarding new users they can remove the public key from the scrape-able location, however an external system may cache the keys which would enable all currently registered users to continue earning rewards. If at any point a project administrator/owner doesn't want their volunteer userbase rewarded they should contact representatives of the external systems for streamlined removal (not a problem on the GRC network).

An upside of using UserID over CPID is that external system functionality wouldn't be interrupted by a CPID change (either accidental or malicious). A disadvantage of UserID is that each user will need to advertise a registration operation for each individual project (an external system's burden, not boinc's problem).

If an UserID registration is ever stolen on an external system, or if a hacker breaks into their account and issues a new registration transaction, the user just needs to log back in (change their password), generate a new message and advertise a new beacon. No more need for a centralized entity responsible for maintaining the registered userbase (improved decentralization).

Affected code

  • Profile: Link to new PHP page. Alternatively: propose a better link location?
  • 2 new PHP files:
    • html/user/openssl_sign_action.php
    • html/user/openssl_sign_form.php
  • Additional openssl public/private key pair.

Issue changelog

  • Changed the openssl function section - It was identified that I used incorrect terminology (sign/verify private key signed message, not decryption of private key encrypted data).
  • Changed advantages to be more accurate.
  • Changed the 'affected code' to reflect the changes to the pull request. It's now just 2 new files, an optional hyperlink and a newly generated openssl key pair.

Thoughts?

Any suggestions/constructive-criticism would be greatly appreciated, thus far I have not begun to implement this however I don't believe it will be that difficult.

Suggestions for alternatives to openssl? (Related article)

@grctest grctest changed the title Proof of UserID ownership using openssl_private_encrypt Proof of UserID ownership using public key cryptography Sep 14, 2017
@grctest
Copy link
Contributor Author

grctest commented Sep 15, 2017

Mirrored this issue on steemit for more attention/input. It was identified that I used incorrect terminology (sign/verify private key signed message, not decryption of private key encrypted data) - I'll need to review how the original message & signed message will be displayed to the user.

Edit: I've updated the original post - see the 'issue changelog' for more info.

@grctest
Copy link
Contributor Author

grctest commented Sep 18, 2017

I've been working on this the last couple days and have now submitted a pull request: #2134

There's a row "UserID auth | Generate signature" under 'account keys' in the user's account page now, it links to a dedicated page which requires the user inputs a message & is returned an xml file download containing:

<boinc_user_id_verification>
 <master_url>http://ip.ip.ip.ip/boincserver/</master_url>
 <userid>1</userid>
 <user_data>12345qwertASDFG</user_data>
 <msg>1 12345qwertASDFG</msg>
 <signature>yU11FhU3yAWvlkDDmIKbfkGU3xGUsL6GyCgnW7Ti/MLFmaa240l7uQRrEAqX/gE7EoMDhILk5BYY8B7liKiDIWoqshikD92sEX9M1MqDk6zmXoBfP3ruZCpD/3NeZCDlClYpSd5sQIbusFgGetinw9CGZU5TFBnKewpPU47xF7lTsiVuz4+5ucdybE2nVkD7VOb/mZW+G7IWDIeKOec6yFEOmqfgXhLrXwGzmBVZTQIIKbYwP63sPUbgQRDYlGsqyxF2Z/PpBEV3gq/j7Tnqtib6YIfzx95+L6UAymXDCYu93RDcL3ko72FLJtgHXrlQfmbPGXk5DWCSTx10yi8XDg==</signature>
</boinc_user_id_verification>

@davidpanderson
Copy link
Contributor

Weak authenticators could potentially be used for this purpose. We'd need to add an RPC for validating a weak auth.

@grctest
Copy link
Contributor Author

grctest commented Oct 10, 2017 via email

@grctest
Copy link
Contributor Author

grctest commented Nov 5, 2017

@grctest
Copy link
Contributor Author

grctest commented Jan 25, 2018

I've created a test server with the latest pull request implemented:
http://209.250.242.113/boincserver/

I'd greatly appreciate trying out the PR's functionality, following the below instructions.

Note: No SSL implemented, do NOT use username/password credentials you use elsewhere (use garbage test username/password).

How to test:

  • Navigate to the test BOINC server
  • Create an account
  • Go to your profile (if you're not already there)
  • Click the "Generate signature" link beside 'UserID auth' within the 'Account information' section.
  • Once there, enter whatever you want into the field & click submit.
  • A download prompt should appear, accept the download.
  • Verify its contents.

You have full permission to try and break/hack this specific proposed feature.

I look forwards to any suggestions/issues.

Cheers 👍

@grctest
Copy link
Contributor Author

grctest commented Mar 30, 2018

Anyone had any success/failure using the test server? Any suggestions for change?

@AenBleidd
Copy link
Member

Looks like it is fixed via #2965. @grctest, please correct me if I'm wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants