crypto implementation fix