When is wp_set_password() called or how to capture a password

No, I would expect wp_user_update to have been what gets used, but I find your motives dubious, and cannot think of a reasonable use for what you want to do

But if you really want to go down this path, use the pre_user_pass filter.

I would also note that there is a reason why passwords are stored as hashes, rather than encrypted, and your code has no encryption mechanism