Tiny and fast ASN.1 decoder in Python

asn1tinydecoder.py is a simple and fast ASN.1 decoder without external libraries designed to parse large files.

Another widely used library for encoding and decoding ASN.1 in python is Pyasn1. This implementation covers many aspects of ASN.1, but the API is very complex and hard to learn. Furthermore Pyasn1 is not designed to parse large files. This why I wrote this tiny ASN.1 decoder. It’s design goal was to be as fast as possible (with Python 2). [1]

A practical application can be found in search_serial_in_large_CRL.py This program creates an index allowing fast search in big ASN.1 data structures.

All python scripts including sample data to parse can be downloaded here.

The source code is hosted on Github.

[1]Python 3 would have been a better choice for asn1tinedecoder.py because of its bytes type. Any volunteer to port to Python 3?

Read more online or download a pdf-rendition of the documentation.


comments powered by Disqus