encsig function added