Golang Password Encryption For Apps and Websites

As one of the first exercises I’ve conducted in Golang as part of getting used to the core language/framework I’ve implemented a simple password authentication package. It uses Bcrypt for actually hashing the password with 64 bit salting created via Dev/Rand which is just standard practice really. This was more an exercise in building something practical and getting a handle on the syntax of doing some slightly more advanced things.

One thing I’ve noticed with Go, especially using this handy dandy Go Plugin, is that it’s forced me to write really clean code(at least I think so). I’ve really been trying to emphasize this lately, but Go seems to really take it to the next level, at least so far with this really simple bit of code. Anyway, I wrote the whole thing to be tested so each function has a well defined responsibility that is easy to call and check.

and the corresponding GoConvey tests:

Boom, a tested, working password authentication package! Not bad for an hour’s work.

As always, this is my first crack based on what I know, and what I read out there on the interwebs today about Golang best practices. Let me know if you see anything blatantly wrong here and I will make it not so blatantly wrong in case any poor fool uses my code.

Web Development Fun

My first programming related post! It’s sad that I’ve been neglecting this as it is what I plan on doing for the rest of my life. Maybe it’s a good thing as I’m more wrapped up in training and cooking then my future employment. I will say however that I really enjoy programming and that there are really interesting ways to apply yourself that can be more fun than “work”.

One of the main deficiencies in my education at the University of Alberta in Computing Science is that we spend virtually no time doing web design until 4th year and even then it is really only one class. We do courses on SQL, Java, C, all of which are valuable, but we haven’t actually built any useful products or projects that we can use as examples in our portfolios. Thankfully one of the courses I am currently enrolled in is based around Software Engineering and Android, so at least I will have some experience with Mobile Development through school! Being the smart student that I am, I realized that if I want to find a job when I graduate, I will have to accumulate some useful experience on my own.

One really cool event that I do yearly to build projects is Startup Weekend. It is a 54 hour hack session where basically ideas are pitched and teams are formed Friday night, Saturday and Sunday until 5 is all about building a working prototype, and Sunday evening is about demoing what you’ve got. So far I’ve helped to build 3 website back ends. One for Crowd Sourcing, a Point of Sales system and most recently we tried building a Dating Website which ended up like a really poorly functioning version of Facebook. I personally love this startup environment and hope to one day do this as my full time profession. Having your database schema drawn on half a whiteboard, your site layout on the other, brainstorming ideas on the fly, and building fast makes for really exciting and challenging work days. Personally, I find I learn more practical stuff in one of these weekends then I do in a course over a full semester.

Any ways, I’ve had building my personal portfolio site on my //todo agenda for a long time so I am planning on having that up and running by the end of the Winter semester. It is a good opportunity to learn some new skills, show off my talent as a web designer, and build a kick ass portfolio site for potential employers all in one shot. I am fairly comfortable with html and doing back end work in PHP but my websites always end up looking so “Web 1.0”  like this:

When what I have in my head is something like this:

So as part of my mission to become a better Web Developer, I plan on learning HTML5, CSS3.0, JavaScript, and some Ruby on Rails the right way. I’ve also ordered a book that helps explain how to choose colours, the science behind logical web layouts, fonts, and all of that other stuff that I’m oblivious too as a “hacker” and not a “designer”. The biggest problem I have when user interfaces are required is choosing colors. I swear I tinker with them for hours and can never good combination. To my enjoyment however I found this great site which has been a god send for at least getting sample colours in my projects.

Much like the training side of my blog, I plan on discussing tips, tricks, resources and my experiences diving head first into Web Development. Wish me luck!