decrypting a title key

  • Thread starter Thread starter fuzzymage
  • Start date Start date
  • Views Views 752
  • Replies Replies 0

fuzzymage

Member
Newcomer
Joined
Aug 14, 2007
Messages
6
Reaction score
0
Trophies
1
XP
110
Country
United States
Just a small personal project of mine, but I'm running into a snag and I'm wondering if I'm going about this properly. I'm using aes-ctr and passing the rightsId as the iv and various titlekeks from my switch, but I'm not getting the expected result. Is there anything obviously wrong with my method?

code w/ edited out keys
from Crypto.Cipher import AES from Crypto.Util import Counter titlekek = b'\x00\x00\x00...' # Replace with actual titlekek (16 bytes for AES-128) encrypted_title_key = b'\x00\x00\x00...' # Replace with actual encrypted title key iv = b'\x00\x00\x00...' # Replace with actual rightsId # Set up AES-CTR mode with the IV as the counter ctr = Counter.new(128, initial_value=int.from_bytes(iv, byteorder='big')) cipher = AES.new(titlekek, AES.MODE_CTR, counter=ctr) # Decrypt and convert to hexadecimal decrypted_title_key = cipher.decrypt(encrypted_title_key) hex_decrypted_title_key = decrypted_title_key.hex() print("Decrypted Title Key (Hex):", hex_decrypted_title_key)
 

Site & Scene News

Popular threads in this forum