get encryption kinda working
fix bounds bugs and warning.  log better on server.