Skip to main content
edited tags
Link
eth
  • 86.5k
  • 53
  • 287
  • 411
deleted 7 characters in body
Source Link
Physes
  • 1.3k
  • 12
  • 18

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. Personas can make other personas in the system into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The first issue can be solved against with modifiers, although I'm not exactly sure the following attempt works (persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading private datastate directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. Personas can make other personas in the system into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The first issue can be solved against with modifiers, although I'm not exactly sure the following attempt works (persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading private data directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. Personas can make other personas in the system into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The first issue can be solved against with modifiers, although I'm not exactly sure the following attempt works (persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading state directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

deleted 52 characters in body
Source Link
Physes
  • 1.3k
  • 12
  • 18

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. There is a range of functions which set pieces of information and personasPersonas can make other personas in the system into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The line of attack is mostly concerned with who can request general info about the person- for example their address history and other details of their public record. Thisfirst issue can be donesolved against with modifiers, although I'm not exactly sure if thisthe following attempt works (assume that persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading private data directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. There is a range of functions which set pieces of information and personas can make other personas into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The line of attack is mostly concerned with who can request general info about the person- for example their address history and other details of their public record. This can be done with modifiers, although I'm not exactly sure if this works (assume that persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading private data directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

I have a citizenship persona contract which acts as a personal identity file which is under the control of the user. Personas can make other personas in the system into trustees or allies. As part of the persona contract I'd like to implement a feature called publicity, which has three settings, denoted by -1, 0, 1. publicity controls who can access the persona's general information.

-1 = only trustees can access info.

0 = trustees and allies can access info.

1 = full publicity to anyone who requests it.

There are two lines of security I'm concerned about: interacting with functions themselves and viewing the state on the blockchain.

The first issue can be solved against with modifiers, although I'm not exactly sure the following attempt works (persona is a struct containing all the relevant details about the human being which can be queried):

mapping(address => int) allies;
mapping(address => int) trustees; //

modifier Security {
    if(persona.publicity = -1) {
        if(trustees[msg.sender] = -1) { 
            _ } else throw;
    } 
    else if(persona.publicity = 0) {
        if(allies[msg.sender] = 0 || trustees[msg.sender] = -1) {
            _ } else throw;
    }
    else _
}
    

I'm not sure if this is valid. Would appreciate if this syntax could be verified.

The second line of attack is reading private data directly on the blockchain. This is a little more complicated. I know many of the state variables that hold data can be encrypted using the sha3(x,y,z) approach. But how would you implement this?

This is the struct which holds persona information:

struct Persona {
        bytes16[] name;
        bytes16[][] residency;
        bytes32 id;
        string origin;
        uint created;
        uint access;
        int birth;
        int exit;
        int publicity;
        int status;
        Sex assigned;
    }
Persona public persona;

How could these state variables be encrypted so that they can't be read on the blockchain? What sort of scheme could you implement so that people in the trustees or allies permission group would be able to decrypt the data on their end? Apologies if this is too much for one question but I think it might be useful for others with permission group/access restriction questions.

Source Link
Physes
  • 1.3k
  • 12
  • 18
Loading