fix encoding issues that was creating a longer encrypted key