removed encrypt func due to cyclic dependency