Page 1 of 1

libaacs - how to check if decryption is possible with VUK from KEYDB.cfg

Posted: 28 Jul 2015 23:03
by nalor
Hello!

I'm searching for a simple way to check if the combination of discid + vuk available in a KEYDB.cfg can be used to decrypt the disc in the drive.

Basically I think the only way to check if a bluray can be decrypted successfully is to use the function 'aacs_decrypt_unit' but I've no idea how to use the 2nd parameter 'buf' ?

Maybe someone can tell me how to use this function and ideally how to modify the aacs_info example provided with libaacs to check if a vuk found in the keydb.cfg is a valid one.

Thanks in advance! :D

Additionally I've noticed a small error in aacs.c - it only affects the formatting of debug messages, but I think it should still be corrected: in function '_find_config_entry' there are 3 sections that output a 'Found xxx key for %s: %s' message - and the first parameter has to be a string, but it isn't - and so the debug output is garbled and unreadable.
'ce->entry.discid' has to be changed to 'str_print_hex(str2, ce->entry.discid, 20)' and str2 has to be defined - this way it's working correctly for me :)

Re: libaacs - how to check if decryption is possible with VUK from KEYDB.cfg

Posted: 30 Jul 2015 10:56
by Jean-Baptiste Kempf
I guess commenting out the processing keys in KEYDB.cfg and running aacs_info would tell you.
If it still succeeds in decoding the disc, the VUK works

Re: libaacs - how to check if decryption is possible with VUK from KEYDB.cfg

Posted: 30 Jul 2015 21:03
by nalor
Hi! Thanks for your answer, but I'd like to test it without trying to play the bluray - just want to check if the VUK can be used to successfully decrypt the bluray.

And yesterday evening I've found the hint to my question here:http://forum.doom9.org/showthread.php?p ... post941401

Now I unterstand that a 'Unit' is simply a fragment of 6144 bytes from an encrypted stream :)

I've tried it a minute ago and the following approach is giving me the result I've been searching for:
  • write DISCID and VUK to a emtpy KEYDB.cfg file
  • execute libaacs: aacs_open2 with devicepath and filename of the new KEYDB.cfg
  • read first 6144 bytes of the first file in \BDMV\STREAM and check if it is encrypted (check is performed in the same way as it is visible at the beginning of 'aacs_decrypt_unit') - if it isn't retry with next file until an encrypted one is found
  • execute libaacs: aacs_decrypt_unit with the buffer to the 6144 bytes and check return value: 1=everything fine - 0=decryption error, VUK wrong
  • execute libaacs: aacs_close
libaacs is really a great library :D

Thanks for the help!