reTHINK-project / dev-registry-global

Global Registry
Apache License 2.0
4 stars 0 forks source link

Global Registry Dataset #2

Closed sgoendoer closed 7 years ago

sgoendoer commented 8 years ago

How should the data be represented in the Global Registry?

We discussed so far having a list of UserIDs, some timestamp, the public key, signature, and salt. We could add a human-readable username and a flag indicating whether the account is still active or not (see #1)

Proposal: Use JSON

GUID: "1V3G0H7EPFG55W52LUG5SN0ZFVTVMQTTZ6Q5TV5BBTIP05IA0E"

{
"guid": "1V3G0H7EPFG55W52LUG5SN0ZFVTVMQTTZ6Q5TV5BBTIP05IA0E",
"userIDs": ["reTHINK://sebastian.goendoer.net/", "reTHINK://facebook.com/fluffy123"],
"lastUpdate":"2015-09-24T08:24:27+00:00",
    "timeout":"2016-09-24T08:24:27+00:00",
"publicKey":"-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAriBpYpmZuLuEaW6wipYh7t+QWZjQRqxe952AgRGpnU5pcr2d4IWc76b2tSbB1xnh6VoW2BotWxYgMbVa6we05+LC6cOsHfLLn8wnZTGctqcKGoEDjnhnO0npBcDvr2W9OwtojzcU4GwGWUGTkznbog2zmLsAGS0WhKYG1kC0iZdc6pi8k/kBTmlL5dRVTWM3usZPwK6arVWRHad+AsIoLKX8qiBV0efRgV9BkqkYZqq4XN1rzPN1jwx3nsUzbpymriGw/6yBWcPK8S2V2wDsoDuFV7mPRK9lhseGgGKfvPbw3AvyEhZZYaImPYAlHterOwHXFWPMoQwXpbB0x6Z8vwIDAQAB-----END PUBLIC KEY-----",
"salt": "eadf5f8e396724da",
"active": 1,
"revoked": 0
} 

furthermore, this JSON object should be put into a JWT as a claim "data". The JWT MUST be signed with the private key matching the public key of the dataset.

rjflp commented 8 years ago

I'm not completely sure we need the salt if we are going to make it public.

sgoendoer commented 8 years ago

The idea for the salt is like this: First, everything in the Global Registry is considered to be publicly accessible. Second, UserIDs are generated in a fixed way, e.g. by hashing the public key using PBKDF2 (with sha256 and 10k (?) iterations)

So in theory, this allows an attacker to "grab" everything (or at least a substantial portion of) the datasets on the DHT.

Trying to break one user's key alone takes now would take an attacker an enormous amount of time: For each iteration, he would have to create a key pair (which is rather slow), then hash it via PBKDF2 (which is slow by design) and see whether the outcome is a collision with the UserID he just attacked.

When in possession of a high number of keys, each "round" would attack all previously grabbed UserIDs at the same time, so in theory: all !

Having a salt, which is public, but unique for each UserID, would force the attacker to attack each UserID separately.

rjflp commented 8 years ago

Got it. Thanks.

sgoendoer commented 8 years ago

I would further propose to use JWT instead of adding signatures directly to the data. This would create a base64-encoded string, which can be verified by a standardized framework instead if a self-defined signing scheme