Update crypto logic