hashcat normally writes a recovered password in clear text to the outfile, the potfile and the screen. That is fine for your own hashes and wrong when you are cracking for someone else, because whoever runs the job can read the result.
--encrypt-with-pubkey closes that gap. The customer makes an RSA key pair and hands over only the public half. hashcat encrypts each recovered password before writing it anywhere, so the operator can run and watch the job and return the result, and only the customer can read it.
The case it was built for is a lost cryptocurrency wallet, where recovery takes days and the seed phrase controls the funds outright.
The customer generates the pair and sends the public key:
$ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out private.pem $ openssl rsa -in private.pem -pubout -out public.pem
The operator names it on the command line:
$ hashcat -m 0 --encrypt-with-pubkey public.pem hashes.txt wordlist.txt
One side effect is worth knowing if you watch a run with tooling: while the option is in use, machine-readable output reports CURKU and PROGRESS as 0, because position in the keyspace would narrow down which candidate matched.