Moved the assignment of rnum into the crypto() function.