added api methods to encryption functions