Skip to content
matllubos edited this page May 16, 2012 · 17 revisions

FreePastry secure id

SecureIDFreePastry adds to the original FreePastry framework SECURE ID. The node identifier is created by random value which is transformed to nodeID with hash function. Both random value and node ID identify Pastry node. Each node will not accept nodeID which is not hash its random value.

SecureIDFreePastry removes attacks surrounding the node or chenges routing tables to attacker neighbors. Because a node must create its ID as hash from random value, attacker can not create IDs which surround attacking node.

Use secure id is very easy. We only need create SecureRandomNodeIdFactory instad of RandomNodeIdFactory as NodeIdFactory and SecurePastrySocketNodeFactory instead of PastrySocketNodeFactory.

SecureRandomId

*For example you can use this code:


   private PastryNode createNode(InetSocketAddress localSocketAddr) throws IOException {
       Environment env = new Environment();
       NodeIdFactory nidFactory = new SecureRandomNodeIdFactory(localSocketAddr.getAddress(), localSocketAddr.getPort(), env);
       PastryNodeFactory pnFactory = new SecurePastrySocketNodeFactory(nidFactory, 
                 localSocketAddr.getAddress(),localSocketAddr.getPort(), env);

       node.boot(bootSocketAddr);
       synchronized (node) {
            while (!node.isReady() && !node.joinFailed()) {
                if (numberOfbootAttempts-- == 0) {
                    node.destroy();
                    throw new IOException("Could not join the FreePastry ring.");
                }
                try {
                    node.wait(500);
                } catch (InterruptedException ex) {
                    throw new IOException("Could not join the FreePastry ring. Reason: " + ex);
                }
                if (node.joinFailed()) {
                    throw new IOException("Could not join the FreePastry ring. Reason: " +              
                             node.joinFailedReason());
                }
            }
        }
    }

We can use SecureIPNodeIdFactory instead of SecureRandomNodeIdFactory. SecureIPNodeIdFactory adds into random value IP address and port. Receiver can check if ID was created from random value and real Node IP address/port.

SecureIPID

More information you can get from FreePastry tutorial

Clone this wiki locally