I want to create a bit-by-bit backup of my DVD and a Blu-ray disc without removing its encryption. Is dd be the best method, and if so, what flags or settings should I use? Also, is comparing the SHA-256 hash of the generated ISO file with the hash of the original disc’s raw data (read from /dev/sr0) the best method for verifying the backup’s integrity?


Blueray have anti-copying built into non-data areas, plus Cinavia DRM on the content most of the time. This means your 1-to-1 copies won’t play.
If you are hoping to make a playable bluray, use one of the tools that reads past both and creates a non-drm image.
Depending on where you live, this likely breaks copywrite, but isn’t illegal.
I know it won’t work with DRM, but my main goal is just to back it up as close to the original as I can. If the disc breaks later, I can burn it to a DVD or Blu-ray and get everything back up and running.
No you can’t. It is a useless blob if data.
If it was possible to copy it bit by bit and just burn it as is, pirates wouldn’t have bothered to remove it.
CSS was specifically designed to fight 1:1 copies, at the time it was conceived, ripping movies to DivX/MP4/h264 wasn’t a thing
The DRM on discs works because they have data in areas that only a glass master in a $5M disc replicator can create
Not to mention that ONE quad layer BD-R for the 4k blu-rays costs $25 - at that point is better to buy two physical copies and hold them in different places for backup