Winni's landfill

apg.go - Yet another APG clone


Permalink:

You may remember my previous blog entry about my APG-clone written in Perl. Well, since I just started learning Go I used it as my first project.

A different programming langauge

I mainly build stuff in the classic scripting languages like Perl, Java-/TypeScript, ZSH/Bash. And while I enjoy using those languages, I often find it fairly annoying having to install lots of packages, dependencies and stuff just to run a simple program. Therefore an alternative language, that can be complied and is capable of running on multiple platforms, is something I was eager to learn. Sure, I could use C or C++, but frankly my C/C++ is so rusty, that chances are high, that I add lots of memory leaks and fucked up pointers to my programs. So I’d rather use something that takes this burden of my shoulders - in other word: that is memory-safe.

I looked at different options:

apg.go

As I wanted to gain some more experience, I settled for a simple project, that shouldn’t be too hard to build with my very limited Go-knowledge. I decided to use my APG clone written in Perl apg.pl as my first real project.

First I tried to replicate the featureset of apg.pl. Once I got that working in Go, I started to implement more features of the original APG. I also took the opportunity to build some propper testing, to also familiarise myself with how tests work in Go.

The result can be found here: apg.go

Binary releases

What’s very cool is, that github.com supports Go workflows out of the box. This way I can build, test and release directly from github.com. Once I am satisfied with the current state of the code, I simply create a new release-tag and Github will automagically build APG binaries for all platforms and architectures, it will zip the files (together with the LICENSE and README.md) and attach it to the release page. This is something I was never able to do with my usual Perl/TypeScript/Bash scripts.

Old and new features

As said, I implemented the same functionality as apg.pl but also added some new features, like the spelling of passwords or using the -M parameter to specify password types in one go.

CLI options available

apg.go is OSS

Same as apg.pl, I released apg.go as OSS under the MIT license. So feel free to use the software and enhance it to your liking. PR are welcome.

Go back