fix some bugs
buffer bug fixed
fix cipher panic