fixed crypto + encoding bugs & features