clean up and fixed key
fixed buffer on the end of the binary string