Unable to crack all CSS keys on disc + other problems

Discussion in 'AnyDVD HD (DVD issues)' started by Evoley, Apr 3, 2019.

  1. Evoley

    Evoley Member

    I recently imported Lord of the Rings and The Hobbit from the UK to the US. The blu-ray's themselves are fine but the dvd's are having a ton of problems being decrypted. I think it takes a good 5 minutes just to decrypt them if AnyDVD even does. I've included ziplogs for all of the discs. I'm running AnyDVD I also tried with other dvd's and they caused problems too.

    Attached Files:

  2. Ch3vr0n

    Ch3vr0n Translator NL & Mod

    The problem is most likely the fact they they're imported. They're coded for region 2, and your drive is coded for region 1. This causes anydvd to have to bruteforce the keys, which in this case isn't infallible.

    If I'm reading the log correctly, you have 3 identical optical drives? In that case, the solution should be relatively simple. If you regularly import disc from the EU, just set one of the drives to region 2 and use that one exclusively for region 2 discs.

    Note: region 2 discs are PAL based where the USA uses NTSC for DVD'S. If you intend to play on a standalone player, keep in mind that most US players NOT support PAL playback and removing encryption does NOT circumvent PAL vs NTSC

    Verstuurd vanaf mijn Nexus 7 met Tapatalk
  3. Evoley

    Evoley Member

    AnyDVD did add the css keys to the key archive. But if I need to change region codes just to watch it then I guess I will. Would prefer not to as I only have 4 user changes on my drives.


    It seems like it did decrept mostly everything. Still got the css key error.

    Summary for drive F: (AnyDVD HD, BDPHash.bin 18-12-06)
    HL-DT-ST BD-REWH14NS40 1.03
    Drive (Hardware) Region: 1
    Current profile: DVD-ROM
    Media is a DVD.
    Booktype: dvd-rom (version 1), Layers: 2 (opposite)
    Size of first Layer: 2062192 sectors (4027 MBytes)
    Total size: 4120544 sectors (8047 MBytes)

    Video DVD (or CD) label: LOTR_RETURN_OF_THE_KING_EXT
    Media is CSS protected!
    Media is locked to region(s): 2!
    Video Standard: PAL

    Removing annoying menu and intro/outro clips!
    Removed 13 annoying menu clips!
    Removing annoying title clips shorter than 0.5 minute(s)!
    Removed 33 annoying title clips!
    Found & removed structural copy protection!
    RCE protection not found.
    UDF filesystem patched!
    Autorun not found on Video DVD.
    Removed CSS copy protection!
    Found & removed 477 potential bad sector protections!
    Emulating RPC-2 drive with region 2!
  4. James

    James Redfox Development Team Staff Member

    It is not an error, it is a warning. Ignore it and enjoy watching.
  5. thetoad

    thetoad Well-Known Member

    I believe (can be corrected?) that the only VOBs that can't really be brute forced are really tiny ones. I'm not sure I ever came across a small VOB that couldn't be brute forced that impacted playback negatively.

    As an aside: I've mentioned before my wish that AnyDVD would use this functionality when mounting a CSS encrypted ISO (i.e. pop up a message like old school dvd decrypter does) telling the user that the disc appears to be CSS encrypted even though the drive is not reporting it as such and would they like to decrypt it. Figure like before I'll be told, "not happening" :)
  6. James

    James Redfox Development Team Staff Member

    Yes, and for a very good reason. Unlike DVD Decrypter, AnyDVD (driver) is designed to decrypt "spontanous" on demand in real time by the file system, a player program, CloneCD, CloneDVD, CloneBD, whatever program you like or the AnyDVD user mode application. You should use DVD Decrypter for this purpose.
    Reading half a disc just to check, if it might be encrypted at some point is really counter productive for real-time decryption.
    But I believe I already told you the last time.
  7. thetoad

    thetoad Well-Known Member

    I guess I don't understand.

    correct me if some of my assumptions are wrong here (pulling out some code that I've written in the past based on libdvdcss, but it could be bad code, I wrote this nearly a decade ago without much understanding of CSS, it just appeared to work)

    1. for a real disc, it's easy to determine if a disc is scrambled, one just calls dvdcss_is_scrambled(input) on the input device. However, this will always return false for an ISO, so one has to be a little smarter.

    1a) therefore, one has to ignore it and look at each VOB block (of size DVDCSS_BLOCK_SIZE or 2048 bits) to see if it is CSS scrambled. there's a bit that will be set (in my code with libdvdcss I did
     if ( ((uint8_t*) tmp_buffer)[0x14] & 0x30 ) {} 
    2a) if a block doesn't have the bit set, you can read it from disc and write it straight out as is, if a block does have it, you have to descramble it.

    2b) the way it would be descrambled in libdvdcss is

    a) dvdcss_seek(input, pos, DVDCSS_SEEK_KEY) (this will brute force the key if needed/possible)
    b) dvdcss_seek(input, pos, DVDCSS_NOFLAGS) (i.e. don't have to get the key, as already got the key for this VOB, assumption is that DVDs don't rekey within a VOB, never actually read the spec)

    3) read to actually do a read that decrypts a block, one does

    dvdcss_read(input, tmp_buffer, 1, DVDCSS_READ_DECRYPT) to read the block that has to be decrypted.

    4) putting that together, basically what my code did was a) do a regular read() b) do my test c) if test says scrambled, do a dvdcss seek/read to correct location. I'm guessing it be a bit simpler in your own code.

    now, under these assumptions,

    is it fair to assume that the test I describe above will always return correctly on a virtual drive (i.e. that the block is scrambled or not).

    If so, can we assume that the only difference between a virtual drive and a physical drive that the virtual drive lies to anydvd about CSS in action.

    If it lies, can we always assume true for those sets of drives (configurable if don't want to autodetect).

    If we assume that CSS is always in action for a virtual drive, will it behave correctly as any block of a VOB that isn't scrambled (i.e. this ISO already had CSS removed) won't have the bit set and therefore we don't have to do dvdcss_read(). I would view this as the show stopper. If we can't trust the bit test I used (i.e. we will actually break non CSS scrambled blocks, which my first iteration did, as I was trying to run the decrypt on non VOB files, which of course broke them, easy enough to fix, stick to only doing it on VOB file blocks)

    The reason I ask, is that I'm guessing you have to do basically go through all this logic anyways on a outside of region disc, the only thing you get is dvdcss_is_scrambled() being correct. If we could basically assume it to be true for virtual discs, would it really change anything from an on demand/real time action, you don't even have to ask the user, it could just be transparent if we already configured anydvd to know that this drive lies.

    thoughts? perhaps I'm talking out of my ass and there's some fatal flaw that I never hit in my simple tests (and then discovered that dvd decrypter did it anyways so didn't have to stress test my code)
    Last edited: Apr 4, 2019
  8. James

    James Redfox Development Team Staff Member

    That's where AnyDVD's check for CSS ends.

    You pointed out the problem very well. Each block. Of the whole disc. Might be scrambled. Or not.
    AnyDVD (driver) allows random access to every sector. It must know what to do the moment you ask for a single sector from a random location without additional delay (real time).

    For what you are after, a program reading & decrypting linear from beginning to end (and brute forcing on the way, if necessary) is the better choice. Like DVD Decrypter.
  9. thetoad

    thetoad Well-Known Member

    but don't you have to do that anyways for an out of region disc. i.e.

    1) read 2048 block buffer in
    2) do test
    3) if test fails (non encrypted) - done - give block to caller as is
    4) if test passes (encrypted) - decrypt.

    is this really extra work / slow?

    the main reason I harp on this, is because I've screwed up multiple times by running dvd decrypter in my setup with anydvd still active. anydvd scrambles the output to dvd decrypter so nothing gets decrypted and the output is broken :(
  10. James

    James Redfox Development Team Staff Member

    No. AnyDVD (driver) does this for every sector, because it may be scrambled or not.
    But for real time decryption, it needs to know HOW to decrypt the sector BEFORE it encounters it.
    It cannot decide during playback, "hey, a scrambled sector! Now I will try to brute force crack.... wait, can't do this with a single sector. Bummer."

    AnyDVD (driver) does this, because some incorrectly authored discs exist, which are not encrypted but have the encrypted bit set.
    Do you understand the problem now?
  11. thetoad

    thetoad Well-Known Member

    I assume it has to precalculate the keys for a non region disc to avoid this issue, otherwise it would be the same? (why wouldn't it be?)

    I assume this is avoided with a real drive for out of region discs as the "dvdcss_is_scrambled()" will tell you if the css bit is real or not. so don't have this problem with badly authored non encrypted discs.

    My final argument would be

    1) for drives that are marked as "virtual" on insertion ask if anydvd should decrypt blocks marked as encrypted. it would be up to the user (so can decide what to do on a disc by disc basis, similar to how I'm asked for blurays what region it should be)
    2) if user wants decryption, precalculate the key for each vob (as I say above, what I assume it has to do for out of region discs, perhaps I'm wrong)

    personally, I think this is doable, but at the end of the day, its not my call. if this discussion doesn't motivate it, I know nothing will. I'll try to drop mentioning of it in the future.
  12. Evoley

    Evoley Member

    I'm curious but is there a reason why AnyDVD takes ages to decrypt a single dvd? I have a NTSC dvd from a bluray+DVD set and the bluray takes like 2 seconds while the dvd takes over 2 minutes. Also... if you can answer a question if at all possible as this relates to The Hobbit/LOTR set I have. As a test I randomly disabled anydvd and used PowerDVD to play it. With AnyDVD I got a black screen. Without it it played perfectly fine. I'm really unsure as to what could cause this.
  13. James

    James Redfox Development Team Staff Member

    Region code mismatch? Brute forcing keys may take some time. Use a second drive with the correct region code, or ask someone for the CSS keys.

    Huh? PowerDVD will not play the disc at all, if the region code doesn't match. Did you allow it to change the code of your drive?
  14. Evoley

    Evoley Member

    All of my bluray's and DVD's are ntsc as I'm from the US. I have 2 box sets that are from the UK. All of my drives are region 1.

    PowerDVD right now is playing without AnyDVD even running with a region 2 bluray in a region 1 bluray drive. With AnyDVD running.... PowerDVD won't even play the region 2 blu-ray despite the region code being removed. Just gives a black screen. MPC-HC and VLC play it just fine.
  15. mmdavis

    mmdavis Well-Known Member

    DVDs are Region 1,2,3 etc. Blurays are Region A, B, C, etc. Are you talking DVD or Bluray? The log in the post you started with has a region 2 LOTR DVD in a Region 1 drive. As has been mentioned, the easiest way to fix it (since you have three drives F:, G:, H) is to set ONE of them to Region 2 and use that drive to read Region 2 discs. Leave the others at Region 1.
  16. Ch3vr0n

    Ch3vr0n Translator NL & Mod

    Which is what I said in post 2 :)

    Sent from my Nexus 6P using Tapatalk