working publish with encryption