SHARE
TWEET

Untitled

a guest May 22nd, 2017 587 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys, os, struct
  2. import hashlib, hmac
  3.  
  4. from Crypto.Cipher import AES
  5.  
  6. def aes_encrypt_ecb(key, input):
  7.     aes = AES.new(key, AES.MODE_ECB)
  8.     output = aes.encrypt(input)
  9.     return output
  10.  
  11. def aes_decrypt_ecb(key, input):
  12.     aes = AES.new(key, AES.MODE_ECB)
  13.     output = aes.decrypt(input)
  14.     return output
  15.  
  16. def aes_encrypt_cbc(key, iv, input):
  17.     aes = AES.new(key, AES.MODE_CBC, iv)
  18.     output = aes.encrypt(input)
  19.     return output
  20.  
  21. def aes_decrypt_cbc(key, iv, input):
  22.     aes = AES.new(key, AES.MODE_CBC, iv)
  23.     output = aes.decrypt(input)
  24.     return output
  25.  
  26. def aes_cmac(key, input):
  27.     aes = AES.new(key, AES.MODE_CMAC)
  28.     output = aes.encrypt(input)
  29.     return output
  30.  
  31. def calculate_sha1_hmac_digest(key, message):
  32.     hash = hashlib.sha1(message).digest()
  33.     return hmac.new(key, hash).digest()
  34.  
  35. def get_sc_key_by_revision(revision):
  36.     return {
  37.         2:   'D413B89663E1FE9F75143D3BB4565274'.decode('hex'),
  38.         3:   'FA72CEEF59B4D2989F111913287F51C7'.decode('hex'),
  39.         4.0: '73636B65795F666F725F6D6173746572'.decode('hex'),
  40.         4.1: 'DAA4B9F2BC70B280A7B340FA0D04BA14'.decode('hex'),
  41.         4.2: '29C194FFEC1FD14D4AAE006C32B35990'.decode('hex'),
  42.  
  43.     }.get(revision)
  44.  
  45. def sc_form_key(type, laid_paid):
  46.     if not type in [0, 1, 2, 3, 4.0, 4.1, 4.2, 5]:
  47.         raise Exception('Wrong type specified')
  48.     if laid_paid is not None and len(laid_paid) != 16:
  49.         raise Exception('Wrong LAID/PAID specified')
  50.     initial_key = get_sc_key_by_revision(type)
  51.     final_key = ''
  52.     for i in xrange(16):
  53.         final_key += chr(ord(initial_key[i]) ^ ord(laid_paid[i]))
  54.     return final_key
  55.  
  56. def sc_encrypt(type, laid_paid, iv, input):
  57.     key = sc_form_key(type, laid_paid)
  58.     return aes_encrypt_cbc(key, iv, input)
  59.  
  60. def sc_decrypt(type, laid_paid, iv, input):
  61.     key = sc_form_key(type, laid_paid)
  62.     return aes_decrypt_cbc(key, iv, input)
  63.  
  64. def sc_combine_laid_paid(laid, paid):
  65.     laid_paid_fmt = '>QQ'
  66.     return struct.pack(laid_paid_fmt, laid, paid)
  67.  
  68. def vtrm_get_laid_paid_from_type(type):
  69.     if not type in [0, 1, 2, 3]:
  70.         raise Exception('Wrong type specified')
  71.     if type == 0:
  72.         laid_paid = sc_combine_laid_paid(0xFFFFFFFFFFFFFFFFL, 0xFFFFFFFFFFFFFFFFL)
  73.     elif type == 1:
  74.         laid_paid = sc_combine_laid_paid(0x1070000002000001L, 0x1070000000000001L)
  75.     elif type == 2:
  76.         laid_paid = sc_combine_laid_paid(0x1070000002000001L, 0x0000000000000000L)
  77.     elif type == 3:
  78.         laid_paid = sc_combine_laid_paid(0x1070000002000001L, 0x10700003FF000001L)
  79.  
  80. def vtrm_encrypt(type, iv, input):
  81.     return sc_encrypt(3, vtrm_get_laid_paid_from_type(type), iv, input)
  82.  
  83. def vtrm_decrypt(type, iv, input):
  84.     return sc_decrypt(3, vtrm_get_laid_paid_from_type(type), iv, input)
  85.  
  86. def vtrm_encrypt_master_0(laid, paid, iv, input):
  87.     return sc_encrypt(4.0, sc_combine_laid_paid(laid, paid), iv, input)
  88.  
  89. def vtrm_encrypt_master_1(laid, paid, iv, input):
  90.     return sc_encrypt(4.1, sc_combine_laid_paid(laid, paid), iv, input)
  91.  
  92. def vtrm_encrypt_master_2(laid, paid, iv, input):
  93.     return sc_encrypt(4.2, sc_combine_laid_paid(laid, paid), iv, input)
  94.    
  95. def vtrm_decrypt_master_0(laid, paid, iv, input):
  96.     return sc_decrypt(4.0, sc_combine_laid_paid(laid, paid), iv, input)
  97.  
  98. def vtrm_decrypt_master_1(laid, paid, iv, input):
  99.     return sc_decrypt(4.1, sc_combine_laid_paid(laid, paid), iv, input)
  100.    
  101. def vtrm_decrypt_master_2(laid, paid, iv, input):
  102.     return sc_decrypt(4.2, sc_combine_laid_paid(laid, paid), iv, input)
  103.  
  104. def vtrm_portability_type_mapper(type):
  105.     return { 0: 1, 1: 3, 2: 2, 3: 5 }.get(type)
  106.  
  107. def vtrm_portability_laid_paid():
  108.     return sc_combine_laid_paid(0x0, 0x0) # TODO
  109.  
  110. def vtrm_encrypt_with_portability(type, iv, input):
  111.     return sc_encrypt(vtrm_portability_type_mapper(type), vtrm_portability_laid_paid(), iv, input)
  112.  
  113. def vtrm_decrypt_with_portability(type, iv, input):
  114.     return sc_decrypt(vtrm_portability_type_mapper(type), vtrm_portability_laid_paid(), iv, input)
  115.  
  116. def test():
  117.     laid_0, paid_0 = 0x1070000001000001L, 0x1070000045000001L # USB_AUTHENTICATOR
  118.     laid_1, paid_1 = 0x1070000002000001L, 0x10700005FF000001L # VSH
  119.     laid_2, paid_2 = 0x1070000002000001L, 0x1070000052000001L # np_trophy
  120.     laid_3, paid_3 = 0x1070000002000001L, 0x107000004E000001L # AD_SIGN
  121.     print "\n"
  122.  
  123.     print "USB_DONGLE_MASTER_KEY upto 3.55"
  124.     master_key = '22D5D18CFFE24FACEC72A242A71898102533E096F2C1910D1523D30774E72B72DFA6DDE9688B762A6A87517F85390BD4203F46890482B73084894BCC9DB1247C'.decode('hex')
  125.     master_iv = '5F5553425F444F4E474C455F41555448'.decode('hex')
  126.     master_magic = '5F5553425F444F4E474C455F'.decode('hex')
  127.     master_output = vtrm_decrypt_master_1(laid_0, paid_0, master_iv, master_key)
  128.     print "KEY:", master_output[len(master_magic): 0x20] .encode('hex'), "\n"
  129.  
  130.     print "USB_DONGLE_MASTER_KEY 3.60+"
  131.     master_key = '8E5145764B66352D694A38D6F871CD1A2526D98E0F3D2DD21FDCFCCF1CF7285FC66EC703DB627F86AAF6B95511D864DD3472C359A0C483A3F7C15B403253D8C3'.decode('hex')
  132.     master_iv = '5F5553425F444F4E474C455F41555448'.decode('hex')
  133.     master_magic = '5F5553425F444F4E474C455F'.decode('hex')
  134.     master_output = vtrm_decrypt_master_2(laid_0, paid_0, master_iv, master_key)
  135.     print "KEY:", master_output[len(master_magic): 0x20] .encode('hex'), "\n"
  136.  
  137.     print "X-PLATFORM-PASSPHRASE 3.50-3.56 CEX/DEX/DECR"
  138.     master_key = '70E6B03F7A364D04091E923D492EAB66B496D3A4D9E40E107B911E1B8B04A7F055C55E6F7AA8374D05169ACBFFDFFB74E86FC3D020078D06112EBE84428A8A72'.decode('hex')
  139.     master_iv = '5890372A42712C50DBA995FFD30FC80C'.decode('hex')
  140.     master_magic = '6438313831396666'.decode('hex')
  141.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  142.     print "KEY0:", master_output[len(master_magic):]
  143.  
  144.     master_key = '09138F12484EA4F0D04CEDF4B82280E43CB588767503D5EFB170AA194D427D4FCAD86C5A2BE0C38074228675105D4099630138067959B9629653DD677D244FA3'.decode('hex')
  145.     master_iv = '5890372A42712C50DBA995FFD30FC80C'.decode('hex')
  146.     master_magic = '6438313831396666'.decode('hex')
  147.     master_output = vtrm_decrypt_master_1(laid_1, paid_1, master_iv, master_key)
  148.     print "KEY1:", master_output[len(master_magic):], "\n"
  149.  
  150.     print "X-PLATFORM-PASSPHRASE 3.60-3.61 CEX/DEX/DECR"
  151.     master_key = '13F9B82E731E0F3B33A58723BB35759EB5E1E85E531E394E9D51CB1918B7DE34F9E3C990862244DFA113D6BACFCD1BB7C77A9D3D9EDB1BC46B2BECFEFA8A486A'.decode('hex')
  152.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  153.     master_magic = '6162666535373465'.decode('hex')
  154.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  155.     print "KEY0:", master_output[len(master_magic):]
  156.    
  157.     master_key = '92CD150E531638E5C504DE6259E459D811F22CBE05A32A1B19D1DAFF0EA5A03F883281EA6B89DFE641BACBC5874D62C171F99BE7B3B931A23B0B948C8C82CED8'.decode('hex')
  158.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  159.     master_magic = '6162666535373465'.decode('hex')
  160.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  161.     print "KEY1:", master_output[len(master_magic):], "\n"
  162.  
  163.  
  164.     print "X-PLATFORM-PASSPHRASE 3.65-3.66 CEX"
  165.     master_key = '13F9B82E731E0F3B33A58723BB35759EB5E1E85E531E394E9D51CB1918B7DE34F9E3C990862244DFA113D6BACFCD1BB7C77A9D3D9EDB1BC46B2BECFEFA8A486A'.decode('hex')
  166.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  167.     master_magic = '6162666535373465'.decode('hex')
  168.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  169.     print "KEY0:", master_output[len(master_magic):]
  170.     master_key = '92CD150E531638E5C504DE6259E459D811F22CBE05A32A1B19D1DAFF0EA5A03F883281EA6B89DFE641BACBC5874D62C171F99BE7B3B931A23B0B948C8C82CED8'.decode('hex')
  171.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  172.     master_magic = '6162666535373465'.decode('hex')
  173.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  174.     print "KEY1:", master_output[len(master_magic):]
  175.    
  176.     master_key = 'DB916811ABB4BC6C51254E14399A2D2751481AB20059EBEF04DE808C7676090D4962FCFFC5ECEF6CA6C70D7263C2AD06C90756F030B139B9215A0173F5AF9B5B'.decode('hex')
  177.     master_iv = 'E93A6A1088E68AC88A376F0C8DF516A1'.decode('hex')
  178.     master_magic = '3463623533383533'.decode('hex')
  179.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  180.     print "KEY2:", master_output[len(master_magic):]
  181.     master_key = '4874DAE67C8B44FD6B6A0B83DBF6BB9C3C45EE44C5E65D3F98BD3CF327CB7420E1753A22AE30EF6F3094FB93D922B112E39A6C9DB45C3E5010C7DBF6E59851FA'.decode('hex')
  182.     master_iv = 'E93A6A1088E68AC88A376F0C8DF516A1'.decode('hex')
  183.     master_magic = '3463623533383533'.decode('hex')
  184.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  185.     print "KEY3:", master_output[len(master_magic):], "\n"
  186.    
  187.     print "X-PLATFORM-PASSPHRASE 3.65-3.66 DEX"
  188.     master_key = '533BFDACB05DB79720386C0B1E47A1B884E6FF3654ED370674FB229F56C5D8EC3C674A9568C68FB748A03F9B3089C3010FFE543BAD5167807D5B32DD2CDFE25B'.decode('hex')
  189.     master_iv = '16D5B7ACC407DFCB13439F83D4437A76'.decode('hex')
  190.     master_magic = '3578787075696377'.decode('hex')
  191.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  192.     print "KEY0:", master_output[len(master_magic):]
  193.     master_key = 'F9A293E9DC2E70B342A760EE57935829AE1C3BDC006AC0E1371D376B5F4536D4825D811CC29CA6883C37FAC2B101AF77F22D66B184D63595D60ADB1742F6138E'.decode('hex')
  194.     master_iv = '16D5B7ACC407DFCB13439F83D4437A76'.decode('hex')
  195.     master_magic = '3578787075696377'.decode('hex')
  196.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  197.     print "KEY1:", master_output[len(master_magic):]
  198.  
  199.     master_key = '718EE2D1C190AFFEBE2C9AC4130C6BF985F1DF2F519E0099E5F79EBA593293BAA9C853EF3E291279C73100B196AB751CBF98CAD8866DC4B0DEA93FAFE3C0B7C0'.decode('hex')
  200.     master_iv = 'E84C298B081CFE0B1C6EDC707BFEE2AB'.decode('hex')
  201.     master_magic = '3261303239336435'.decode('hex')
  202.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  203.     print "KEY2:", master_output[len(master_magic):]
  204.     master_key = '4007EE74BB5414127756348B1D68605054B4370E2DF834FB8C9DF2B8E78582376BF0ACCD8A02373592DDF6DCEDC2ED1192E61B5571F09F39044D746C0F5E5BB7'.decode('hex')
  205.     master_iv = 'E84C298B081CFE0B1C6EDC707BFEE2AB'.decode('hex')
  206.     master_magic = '3261303239336435'.decode('hex')
  207.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  208.     print "KEY3:", master_output[len(master_magic):], "\n"
  209.  
  210.     print "X-PLATFORM-PASSPHRASE 3.70-4.00 CEX/DEX"
  211.     master_key = '13F9B82E731E0F3B33A58723BB35759EB5E1E85E531E394E9D51CB1918B7DE34F9E3C990862244DFA113D6BACFCD1BB7C77A9D3D9EDB1BC46B2BECFEFA8A486A'.decode('hex')
  212.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  213.     master_magic = '6162666535373465'.decode('hex')
  214.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  215.     print "KEY0:", master_output[len(master_magic):]
  216.     master_key = '92CD150E531638E5C504DE6259E459D811F22CBE05A32A1B19D1DAFF0EA5A03F883281EA6B89DFE641BACBC5874D62C171F99BE7B3B931A23B0B948C8C82CED8'.decode('hex')
  217.     master_iv = '0E2B5FAEB84E528418D7A8011E0897AE'.decode('hex')
  218.     master_magic = '6162666535373465'.decode('hex')
  219.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  220.     print "KEY1:", master_output[len(master_magic):]
  221.  
  222.     master_key = '5D2F3C16A28A5B79EC6611248A5542525D7154F4D2DC5A140D0FF853CE7B681AA14A36899A03BF18BEC2F3B898218834E51F0504ED1C36CFA0574CD0F6AFA4AD'.decode('hex')
  223.     master_iv = '9826F8E6714DF41E768EEA81AA87BF39'.decode('hex')
  224.     master_magic = '3636613263643533'.decode('hex')
  225.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  226.     print "KEY2:", master_output[len(master_magic):]
  227.     master_key = 'FBD2E4A297A129F0071B8CC4F7F1B67B31FE23C359CF9C6106639B5013667F8C778E1F11BB2CB824728F26DFF1D6347D75E45F379928CCF74ED334FD7333EBCC'.decode('hex')
  228.     master_iv = '9826F8E6714DF41E768EEA81AA87BF39'.decode('hex')
  229.     master_magic = '3636613263643533'.decode('hex')
  230.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  231.     print "KEY3:", master_output[len(master_magic):], "\n"
  232.  
  233.     print "X-PLATFORM-PASSPHRASE 4.10-4.11_CEX"
  234.     master_key = '5D2F3C16A28A5B79EC6611248A5542525D7154F4D2DC5A140D0FF853CE7B681AA14A36899A03BF18BEC2F3B898218834E51F0504ED1C36CFA0574CD0F6AFA4AD'.decode('hex')
  235.     master_iv = '9826F8E6714DF41E768EEA81AA87BF39'.decode('hex')
  236.     master_magic = '3636613263643533'.decode('hex')
  237.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  238.     print "KEY0:", master_output[len(master_magic):]
  239.     master_key = 'FBD2E4A297A129F0071B8CC4F7F1B67B31FE23C359CF9C6106639B5013667F8C778E1F11BB2CB824728F26DFF1D6347D75E45F379928CCF74ED334FD7333EBCC'.decode('hex')
  240.     master_iv = '9826F8E6714DF41E768EEA81AA87BF39'.decode('hex')
  241.     master_magic = '3636613263643533'.decode('hex')
  242.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  243.     print "KEY1:", master_output[len(master_magic):]
  244.    
  245.     master_key = 'FE44B5DFBC45C33A86FCD1451703C45A1380322A374243A41849CA579920297BE053199681EBE7E7C183ED78C8C62E7C6584D36665F6CCA761F28EACA6241D45'.decode('hex')
  246.     master_iv = 'A24BBE5EFA5EE57101A67315DDEFD9A8'.decode('hex')
  247.     master_magic = '6330373937633564'.decode('hex')
  248.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  249.     print "KEY2:", master_output[len(master_magic):]
  250.     master_key = 'B55A7496DC4C083106C8A5D85C9AEB86620AB06895FC26ADB4B0D6CB985B5BBF90629170F109633D13CF499C45EE3D245C8A5AB817D7F8E1FF336BEA52902E70'.decode('hex')
  251.     master_iv = 'A24BBE5EFA5EE57101A67315DDEFD9A8'.decode('hex')
  252.     master_magic = '6330373937633564'.decode('hex')
  253.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  254.     print "KEY3:", master_output[len(master_magic):], "\n"
  255.  
  256.     print "X-PLATFORM-PASSPHRASE 4.20-4.25 CEX"
  257.     master_key = 'FE44B5DFBC45C33A86FCD1451703C45A1380322A374243A41849CA579920297BE053199681EBE7E7C183ED78C8C62E7C6584D36665F6CCA761F28EACA6241D45'.decode('hex')
  258.     master_iv = 'A24BBE5EFA5EE57101A67315DDEFD9A8'.decode('hex')
  259.     master_magic = '6330373937633564'.decode('hex')
  260.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  261.     print "KEY0:", master_output[len(master_magic):]
  262.     master_key = 'B55A7496DC4C083106C8A5D85C9AEB86620AB06895FC26ADB4B0D6CB985B5BBF90629170F109633D13CF499C45EE3D245C8A5AB817D7F8E1FF336BEA52902E70'.decode('hex')
  263.     master_iv = 'A24BBE5EFA5EE57101A67315DDEFD9A8'.decode('hex')
  264.     master_magic = '6330373937633564'.decode('hex')
  265.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  266.     print "KEY1:", master_output[len(master_magic):]
  267.    
  268.     master_key = '14A3214C53270849D615B2A2694F24C7FB391D0CC3380B127B2A5F0CFF9989FE4EDF0F1E467B2C7F2C8FAFD403240D92E97A4B6EAA3C3838920D8F5CD89F2A75'.decode('hex')
  269.     master_iv = 'FDC8669ED56E00B16F3C419254F5A5AE'.decode('hex')
  270.     master_magic = '7275636665717677'.decode('hex')
  271.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  272.     print "KEY2:", master_output[len(master_magic):]
  273.     master_key = 'DED52102FC0640D59CB25A698EE97B3833044964FFED34F1CC9AC383317D91AB0C94B86F1FEEA0687981CCF5692D2B500AF9B9F871C89E0C5A79902F4EBD4E13'.decode('hex')
  274.     master_iv = 'FDC8669ED56E00B16F3C419254F5A5AE'.decode('hex')
  275.     master_magic = '7275636665717677'.decode('hex')
  276.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  277.     print "KEY3:", master_output[len(master_magic):], "\n"
  278.  
  279.     print "X-PLATFORM-PASSPHRASE 4.30-4.80 CEX"
  280.     master_key = '14A3214C53270849D615B2A2694F24C7FB391D0CC3380B127B2A5F0CFF9989FE4EDF0F1E467B2C7F2C8FAFD403240D92E97A4B6EAA3C3838920D8F5CD89F2A75'.decode('hex')
  281.     master_iv = 'FDC8669ED56E00B16F3C419254F5A5AE'.decode('hex')
  282.     master_magic = '7275636665717677'.decode('hex')
  283.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  284.     print "KEY0:", master_output[len(master_magic):]
  285.     master_key = 'DED52102FC0640D59CB25A698EE97B3833044964FFED34F1CC9AC383317D91AB0C94B86F1FEEA0687981CCF5692D2B500AF9B9F871C89E0C5A79902F4EBD4E13'.decode('hex')
  286.     master_iv = 'FDC8669ED56E00B16F3C419254F5A5AE'.decode('hex')
  287.     master_magic = '7275636665717677'.decode('hex')
  288.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  289.     print "KEY1:", master_output[len(master_magic):]
  290.    
  291.     master_key = 'D70421F2929CE3656BAC5DF8B19A5C27130290C6EA04F0BEB27D13DC204E4F259A3E485AA76D50F58467BD9ED776075565913AC88D2BCC2B2FA4D65F08281FA2'.decode('hex')
  292.     master_iv = 'EDF4AE21E798B263032436D757A76383'.decode('hex')
  293.     master_magic = '6237666538303262'.decode('hex')
  294.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  295.     print "KEY2:", master_output[len(master_magic):]
  296.     master_key = '4C4ED1961D409C3BFAEE60A59A80CB0DEFC2CE93877A386716158CA5A8EE26608E0E03DE05BBEDD0D4033840B50EB85730B22508C2AEF9D387BD594D1944AE83'.decode('hex')
  297.     master_iv = 'EDF4AE21E798B263032436D757A76383'.decode('hex')
  298.     master_magic = '6237666538303262'.decode('hex')
  299.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  300.     print "KEY3:", master_output[len(master_magic):], "\n"
  301.    
  302.    
  303.     print "Sysconf_plugin"
  304.     master_key = 'CD861E6B3F623037EAD75EDCA20172CA629A36F7D9BA6BB6974BFD755E4419DABD2CC50FE575094C337AE27ACC35738E659F96A682D4EBDD6E31E19256B95876'.decode('hex')
  305.     master_iv = '54671E7C11357A933C66E61ECAF22E9C'.decode('hex')
  306.     master_magic = '5343455F5243525F686F73746E616D65'.decode('hex')
  307.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  308.     print "KEY0:", master_output[len(master_magic):]
  309.     master_key = 'EB924B4A49CB1F640A748E78F794AAFEAC432B11609049BE9658ED4D92CC2BAB15590983444DD833208E2BC7932AEF85D1E1F27206FC474E49954EA016B31FA9'.decode('hex')
  310.     master_iv = '261430D594B47295D35E8721FA05819D'.decode('hex')
  311.     master_magic = '5343455F5243525F686F73746E616D65'.decode('hex')
  312.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  313.     print "KEY1:", master_output[len(master_magic):]
  314.    
  315.     master_key = 'F5977DFAFC041E8684F5B77E510AE95996CC069D7C0E70A5EDDBF43166F0656B5D62A79198A92F79FA26B56DB175E88AE7262A7D014D4165B6E5E317FD962C74'.decode('hex')
  316.     master_iv = '54671E7C11357A933C66E61ECAF22E9C'.decode('hex')
  317.     master_magic = '5343455F43444E5F686F73746E616D65'.decode('hex')
  318.     master_output = vtrm_decrypt_master_2(laid_1, paid_1, master_iv, master_key)
  319.     print "KEY2:", master_output[len(master_magic):]
  320.     master_key = '61F6AD87D6A98EB627CE5384381DDB0E3E163C7F19E29872C5E051FBCB4AE95AC47E800C35298E91FED306CC88CF73B1EF3A2713AA5B7FF305AF7C355F3E21BB'.decode('hex')
  321.     master_iv = '261430D594B47295D35E8721FA05819D'.decode('hex')
  322.     master_magic = '5343455F43444E5F686F73746E616D65'.decode('hex')
  323.     master_output = vtrm_decrypt_master_0(laid_1, paid_1, master_iv, master_key)
  324.     print "KEY3:", master_output[len(master_magic):], "\n"
  325.  
  326.     print "SCEI_AD_SIGN"
  327.     master_key = 'E8542AFF1FA7D015FF50D54856CAEFD163FA187E9ACA1F6563156AD424C84C1C18DD9DEBBDD1015AC4CBC9DB5200340CCFF40B7274335D0BF865FB12E4FD26D3'.decode('hex')
  328.     master_iv = '792B4AE1B4107A97230A2326DAF030A9'.decode('hex')
  329.     master_magic = '534345495F41445F5349474E00000000'.decode('hex')
  330.     master_output = vtrm_decrypt_master_1(laid_3, paid_3, master_iv, master_key)
  331.     print "RIV0:", master_output[len(master_magic): 0x20] .encode('hex')
  332.     print "KEY0:", master_output[len(master_magic)+0x10: 0x30] .encode('hex')
  333.     master_key = 'B71533C40E0209F4181A5A28F0A1C50616DA68AC5ADF1DC6594F5D546D927A2E89755DB623BE5732251BAE414AC1FB5F252F6CB85CEBDF1E959A678B2E90507A'.decode('hex')
  334.     master_iv = '792B4AE1B4107A97230A2326DAF030A9'.decode('hex')
  335.     master_magic = '534345495F41445F5349474E00000000'.decode('hex')
  336.     master_output = vtrm_decrypt_master_0(laid_3, paid_3, master_iv, master_key)
  337.     print "RIV1:", master_output[len(master_magic): 0x20] .encode('hex')
  338.     print "KEY1:", master_output[len(master_magic)+0x10: 0x30] .encode('hex'), "\n"
  339. test()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top