converting external crypto libs into angular services