modified crypto impl