Fix special case with null byte input
Add decrypt, refactor