fix leaks

fix the encrypt: function leak