Discussion:
[libdvdcss-devel] bit perfect copies of CSS DVDs
Christoph Anton Mitterer
2015-06-30 20:08:15 UTC
Permalink
Hey.

I was looking into making ideally bit-perfect copies of some ageing
DVDs after some of them started to fail.

Some questions, where some of you could possibly help me:


1) I've always thought that CSS was operating just on the file level,
but apparently when reading out a DVD with dd, one gets gazillions of
block errors and it seems that these aren't just intentional error
blocks, cause when one reads the disc with ddrescue its contents can't
still be played afterwards.

I've noticed, though, that when one plays the disc with some player
that uses libdvdcss, dd works just fine.

So is there actually some drive level encryption that happens before
the block layer, and libdvdcss initialises the drive with the correct
keys?
Right?


2) I further noticed that even when first playing the DVD and then
creating an image with e.g. dd (which works fine then), the contents of
the UDF fs within that image differ binary from what e.g. tools like
dvdbackup would dump me to disk (i.e. VOBs, IFOs, etc. but without the
UDF fs around).

So it seems that in addition to the drive level encryption/protection,
which is defeated in (1), there's still another file level encryption?
Right?


3) Interestingly, when I create two images of the same DVD (without
ejecting it in the meantime or clearing up ~/.dvdcss/) than these
images still always differ in 10 bytes or so, always at the same
location.
Any idea why?


Thanks,
Chris.
Jean-Baptiste Kempf
2015-06-30 20:16:46 UTC
Permalink
Hello,
Post by Christoph Anton Mitterer
So is there actually some drive level encryption that happens before
the block layer, and libdvdcss initialises the drive with the correct
keys?
Right?
Right. CSS is both at the file level and at the disk level. You cannot
dd directly and have something working.
Therefore, when doing copies, you will always remove some part of CSS
encryption.
Post by Christoph Anton Mitterer
2) I further noticed that even when first playing the DVD and then
creating an image with e.g. dd (which works fine then), the contents of
the UDF fs within that image differ binary from what e.g. tools like
dvdbackup would dump me to disk (i.e. VOBs, IFOs, etc. but without the
UDF fs around).
So it seems that in addition to the drive level encryption/protection,
which is defeated in (1), there's still another file level encryption?
Right?
Well, yes, but I don't know how is that related to your 2).
Are you referring about ARCCOS system?
Post by Christoph Anton Mitterer
3) Interestingly, when I create two images of the same DVD (without
ejecting it in the meantime or clearing up ~/.dvdcss/) than these
images still always differ in 10 bytes or so, always at the same
location.
Any idea why?
No. That seems like a bug.

With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Christoph Anton Mitterer
2015-06-30 21:27:15 UTC
Permalink
Hey.
Post by Jean-Baptiste Kempf
Right. CSS is both at the file level and at the disk level. You cannot
dd directly and have something working.
Therefore, when doing copies, you will always remove some part of CSS
encryption.
I see, but even after one has basically "initialised" the device with
the correct key (by first playing the media via libdvdcss), then the
UDF still contains files with further CSS encryption, which is why my
dd dump, when mounted and played afterwards, still shows libdvdcss in
working, right?

btw: I noticed the following
When I play the real physical DVD, and dvdcss creates the cache entry
it's named e.g.:
SOME_TITLE-2000102812240400-17a487205e/

but when playing the dd image, it will create:
SOME_TITLE-2000102812240400-0000000000/

Is this kinda expected?
Post by Jean-Baptiste Kempf
Post by Christoph Anton Mitterer
2) I further noticed that even when first playing the DVD and then
creating an image with e.g. dd (which works fine then), the
contents of
the UDF fs within that image differ binary from what e.g. tools like
dvdbackup would dump me to disk (i.e. VOBs, IFOs, etc. but without the
UDF fs around).
So it seems that in addition to the drive level
encryption/protection,
which is defeated in (1), there's still another file level
encryption?
Right?
Well, yes, but I don't know how is that related to your 2).
Well in (1) "we found out", that there's
a) encryption at the drive level, which would give me the block level
errors when the drive isn't sent the key
b) encryption at the file level, which is still in place after (a) has
been done
Right?

So when I dd the disk and mount the UDF image afterwards as loopback
device, then (a) is gone, but (b) is still present and will need to be
decrypted.


When I "backup" the disk however with e.g. dvdbackup, then I don't get
an UDF image but rather normal files VIDEO_TS/*.
And those are (by name) the same as in the dd'ed UDF image, but the
binary content of both differs largely.

So I assumed, that dvdbackup would also do away with (b) and that's why
the files differ.
Post by Jean-Baptiste Kempf
Are you referring about ARCCOS system?
Not sure, is there a way to find out whether ARccOS is used?
Post by Jean-Baptiste Kempf
Post by Christoph Anton Mitterer
3) Interestingly, when I create two images of the same DVD (without
ejecting it in the meantime or clearing up ~/.dvdcss/) than these
images still always differ in 10 bytes or so, always at the same
location.
Any idea why?
No. That seems like a bug.
hmm strange... any idea where the bug could be? hardware issue?
libdvdcss?

Just to make things clear:
The difference is somewhere in the UDF between the two images of the
same disc.
But when I loop mount those two dd'ed images and diff the files within
them - those are the same.

That's why I thought maybe that's part of CSS, i.e. that the drive
kinda watermarks the UDF.


Thanks,
Chris.
Jean-Baptiste Kempf
2015-07-01 08:16:22 UTC
Permalink
Post by Christoph Anton Mitterer
Post by Jean-Baptiste Kempf
Right. CSS is both at the file level and at the disk level. You cannot
dd directly and have something working.
Therefore, when doing copies, you will always remove some part of CSS
encryption.
I see, but even after one has basically "initialised" the device with
the correct key (by first playing the media via libdvdcss), then the
UDF still contains files with further CSS encryption, which is why my
dd dump, when mounted and played afterwards, still shows libdvdcss in
working, right?
If I understand correctly what you say, yes.
Post by Christoph Anton Mitterer
Post by Jean-Baptiste Kempf
Post by Christoph Anton Mitterer
So it seems that in addition to the drive level
encryption/protection,
which is defeated in (1), there's still another file level
encryption?
Right?
Well, yes, but I don't know how is that related to your 2).
Well in (1) "we found out", that there's
a) encryption at the drive level, which would give me the block level
errors when the drive isn't sent the key
b) encryption at the file level, which is still in place after (a) has
been done
Right?
Correct.
Post by Christoph Anton Mitterer
So when I dd the disk and mount the UDF image afterwards as loopback
device, then (a) is gone, but (b) is still present and will need to be
decrypted.
Correct.
Post by Christoph Anton Mitterer
When I "backup" the disk however with e.g. dvdbackup, then I don't get
an UDF image but rather normal files VIDEO_TS/*.
And those are (by name) the same as in the dd'ed UDF image, but the
binary content of both differs largely.
So I assumed, that dvdbackup would also do away with (b) and that's why
the files differ.
Your backup is probably removing the CSS encryption.
Post by Christoph Anton Mitterer
Post by Jean-Baptiste Kempf
Are you referring about ARCCOS system?
Not sure, is there a way to find out whether ARccOS is used?
If your dump make 40GB, or if you see 99 titles.
Post by Christoph Anton Mitterer
hmm strange... any idea where the bug could be? hardware issue?
libdvdcss?
Sorry, none.
Post by Christoph Anton Mitterer
The difference is somewhere in the UDF between the two images of the
same disc.
But when I loop mount those two dd'ed images and diff the files within
them - those are the same.
That's why I thought maybe that's part of CSS, i.e. that the drive
kinda watermarks the UDF.
Did you read the analysis about DVDCSS?
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Loading...