Fixed DES/TripleDES padding and added unit tests

I've added the DES padding fixes to the devel branch. I had to export the original DES functionality so I could unit test it, hopefully it follows your pattern ok but feel free to modify if it doesn't