Proteus – a command-line program for radix base conversion

There’s a github project by the name of Proteus that I started recently. It supports the basics such as converting ASCII text ⇒ Binary, or OctalBase64 and so on. While you can find any number of online sites that have webtools which can convert blocks of text (or integers) for you, there’s really no basic tool out there for converting.

Proteus Screenshot
Verbose [and colored] example of binary-to-ascii conversion

There’s some really great features:

Its written in Python really just about any environment can use this tool. It also means that it would be easy to integrate into other Python projects or call from other scripts or software programs.

Supports the most widely used bases or radices

..such as Binary, Octal (Base-8), Decimal, Hex, Base-32, and Base-64.

Supports Drop-in Conversion

..because of how the code is designed, when a new method has been completed to incorporate a new base/radix, it requires very little in the way of modification (requiring simply following the current naming convention and adding a single-word string element to an array).

Can Detect Encodings! examining the string of text/data that is passed to it, there’s no need to even know what the base-encoding is ahead of time! While this ability to detect the radix type increases with the size of whatever is passed to it (and so isn’t necessarily 100% accurate with smaller strings), this capability works very well as it is, and only stands to be improved in the future.

No-Frills/No-Nonsense by Default

..having been built from the ground-up with the idea that it would be useful for not only quick command line operations, but also as a library or having GUI wrappers created, so it is non-interactive and meant to be easily used for single operations. Since it can auto-detect radices and defaults to outputting in ASCII format, converting an encoded datastream can be as simple as passing only that text as the lone argument.

Privacy / Security

There’s no way of knowing what kind of information is being captured when using these web tools everyone uses when re/de-coding. With this tool, you never have to worry about that. Since its both open-source and is a script, you can easily read the code yourself to see what its doing.

It’s currently in the early stages in terms of a comprehensive conversion tool, there is refactoring that needs to be completed, and additional functionality, such as Base-85 being currently in the works (and others to follow).

For Debian-based Linux distributions, there are signed debian packages available of the latest stable version and includes a basic man page. Generated with the help2man command-line tool.

While its true that this serves as a wrapper for conventional conversions (particularly those associated with base32 & base64, using the built-in base64 library) this tool’s primary purpose is to provide quick command-line conversion ability without the need to remember functions or libraries or anything of the kind.

Lately, I’ve been finding myself using these kinds of conversions (or other types of crypto-related deciphering) when engaging in fun augmented-reality cyber-warfare tests, such as those from the NSA and ISA (i.e Shin Bet or Israeli Security Agency) campaigns for recruitment. They come in different forms, such as a tweet or ad (respectively). This practice is also popular with security/cyber-warfare related games, such as those by Alice & Smith, the makers of The Black Watchmen game or the upcoming Nite Team 4.

Belisarius Smith consults as a software engineer, cloud engineer, and security adviser. He has a BSBA in Security Management and is currently completing graduate studies in the Engineering Department at Penn State University with a Masters of Software Engineering. When he isn't traveling, mountain climbing, or reading, he spends his spare time on personal side projects and studies.

Leave a Reply