if you're using photoshop, in : preferences > general > image interpolation, choose "nearest neighbour" from the drop down menu. Now you can resize and preserve hard edges.
I think in most of the image editing softs, you will just have to set the image resampling to nearest neighbour and avoid bicubic or bilinear.
Which tool are you using ?