Coder Social home page Coder Social logo

pydnssec's Introduction

PyDNSSEC

PyDNSSEC is a DNSSEC toolkit for Python. It supports public/private keypairs generation and resource records signing and verification using DNSSEC.

The toolkit is based on dnspython (http://www.dnspython.org/), and uses PyCrypto (http://www.pycrypto.org/) for cryptography operations. Both packages are required by PyDNSSEC.

Features:

  • Public/private keypairs generation
  • Export to DNSSEC private key format
  • Resource record signing
  • Whole zone signing
  • Both NSEC and NSEC3 are supported

DNSKEY algorithm support:

  • RSAMD5 (1): not supported
  • DSA (3): not supported
  • RSASHA1 (5): supported
  • DSANSEC3SHA1 (6): not supported
  • RSASHA1NSEC3SHA1 (7): supported
  • RSASHA256 (8): supported
  • RSASHA512 (10): supported
  • ECDSAP256SHA256 (13): planned
  • ECDSAP384SHA384 (14): planned

Recent RFC-6944 defines which algorithms should be supported by DNSSEC implementations. As ECDSAP256SHA256 and ECDSAP384SHA384 are recommended, they will be implemented soon.

EXAMPLES

Key generation and exporting to DNSSEC private key files:

from dns import zone
import os
import dnssec

ksk = dnssec.PrivateDNSKEY.generate(
        dnssec.DNSKEY_FLAG_ZONEKEY | dnssec.DNSKEY_FLAG_SEP, 
        dnssec.RSASHA256, bits=2048
)
ksk.to_file('example.com', os.path.dirname(__file__))

zsk = dnssec.PrivateDNSKEY.generate(
        dnssec.DNSKEY_FLAG_ZONEKEY, 
        dnssec.RSASHA256, bits=1024
)
zsk.to_file('example.com', os.path.dirname(__file__))

Zone signing:

z = zone.from_file('example.com.zone', origin='example.com.')
dnssec.sign_zone(z, [ksk, zsk])
z.to_file('example.com.signed', relativize=False)

Zone unsigning (removes all DNSSEC specific resource records from it):

dnssec.unsign_zone(z) 
z.to_file('example.com.unsigned', relativize=False)

INSTALLATION

The module is packed using distutils, so it can be easily installed by running following command from the package directory:

python setup.py install

PyCrypto and dnspython packages are required by PyDNSSEC.

pydnssec's People

Contributors

tomas-mazak avatar bugdone avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.