According to Apple, there’s no real scanning of photos going on here. Essentially, Apple assigns your photo a “neural hash” (a string of numbers identifying your photo), then compares that against hashes from the CSAM database. It then saves that process in what Apple calls a Safety Voucher, along with the image.
Then it does some more analysis and matching based on these hashes; if 30 Safety Vouchers have matches for CSAM images, only then is your account flagged by the system for human reviewers to go in to actually see if there are illegal images, and the images and account are reported.
How to stop Apple from scanning your iPhone photos
So, now that you know how the system works, you can choose if you want to stop Apple from doing it. This scanning only happens when photos are uploaded to iCloud.
Photos that are sent in messaging apps like WhatsApp or Telegram aren’t scanned by Apple. Still, if you don’t want Apple to do this scanning at all, your only option is to disable iCloud Photos. To do that, open the “Settings” app on your iPhone or iPad, go to the “Photos” section, and disable the “iCloud Photos” feature. From the popup, choose the “Download Photos & Videos” option to download the photos from your iCloud Photos library.
You can also use the iCloud website to download all photos to your computer. Your iPhone will now stop uploading new photos to iCloud, and Apple won’t scan any of your photos now.
Looking for an alternative? There really isn’t one. All major cloud-backup providers have the same scanning feature, it’s just that they do it completely in the cloud (while Apple uses a mix of on-device and cloud scanning). If you don’t want this kind of photo scanning, use local backups, NAS, or a backup service that is completely end-to-end encrypted.