Distributed Hash Tables, Part I
Listing 6. portscan.py
def __main__(): id=int(random.uniform(0,2**k)) node=Node(id) join(node, initialContact) line=raw_input('Enter an IP to scan: ').trim() key=long(sha.new(line).hexdigest(),16) value=lookup(node, key) if value==None: f=os.popen('nmap '+args) lines=f.readlines() value=string.join(lines, '\n') store(node, key, value)
In this installment of our two-part series, we discussed the theory behind building DHTs. Next time, we'll talk about practical issues in using DHTs in real-world applications.
Brandon Wiley is a peer-to-peer hacker and current president of the Foundation for Decentralization Research, a nonprofit corporation empowering people through technology. He can be contacted at email@example.com.
Webinar: 8 Signs You’re Beyond Cron
11am CDT, April 29th
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.Join us!
- March 2015 Issue of Linux Journal: High-Performance Computing
- Not So Dynamic Updates
- April 2015 Video Preview
- Users, Permissions and Multitenant Sites
- New Products
- Flexible Access Control with Squid Proxy
- Security in Three Ds: Detect, Decide and Deny
- DevOps: Everything You Need to Know
- Non-Linux FOSS: MenuMeters
- Tighten Up SSH