(serial_number, verbose=False)
return AES.new(''.join(k), AES.MODE_ECB, iv), k
UD20160103001874
UD20160103001874
UD20160103001874
def new_crypto_key(serial_number, verbose=False):
    k = ['\0'] * 16
    'UD20160103001874'
    ['4', '7', '7', '8', '8', '8', '7', '1', '4', '1', '7', '7', '1', '1', '7', '4']
    k[0] = serial_number[-1]
    k[1] = serial_number[-2]
    k[2] = serial_number[-2]
    k[3] = serial_number[-3]
    k[4] = serial_number[-3]
    k[5] = serial_number[-3]
    k[6] = serial_number[-2]
    k[7] = serial_number[-4]
    k[8] = serial_number[-1]
    k[9] = serial_number[-4]
    k[10] = serial_number[-2]
    k[11] = serial_number[-2]
    k[12] = serial_number[-4]
    k[13] = serial_number[-4]
    k[14] = serial_number[-2]
    k[15] = serial_number[-1]
    if verbose:
        print("EmotivCrypto: Generated Crypto Key from Serial Number...\n"
              "   Serial Number - {serial_number} \n"
              "   AES KEY - {aes_key}".format(serial_number=serial_number, aes_key=k))
    return AES.new(''.join(k), AES.MODE_ECB, iv), k
def new_crypto_key ( serial_number , verbose = False ) : k = [ '\0' ] * 16 [ '4' , '7' , '7' , '8' , '8' , '8' , '7' , '1' , '4' , '1' , '7' , '7' , '1' , '1' , '7' , '4' ] k [ 0 ] = serial_number [ - 1 ] k [ 1 ] = serial_number [ - 2 ] k [ 2 ] = serial_number [ - 2 ] k [ 3 ] = serial_number [ - 3 ] k [ 4 ] = serial_number [ - 3 ] k [ 5 ] = serial_number [ - 3 ] k [ 6 ] = serial_number [ - 2 ] k [ 7 ] = serial_number [ - 4 ] k [ 8 ] = serial_number [ - 1 ] k [ 9 ] = serial_number [ - 4 ] k [ 10 ] = serial_number [ - 2 ] k [ 11 ] = serial_number [ - 2 ] k [ 12 ] = serial_number [ - 4 ] k [ 13 ] = serial_number [ - 4 ] k [ 14 ] = serial_number [ - 2 ] k [ 15 ] = serial_number [ - 1 ] if verbose : print ( "EmotivCrypto: Generated Crypto Key from Serial Number...\n" "   Serial Number - {serial_number} \n" "   AES KEY - {aes_key}" . format ( serial_number = serial_number , aes_key = k ) ) return AES . new ( '' . join ( k ) , AES . MODE_ECB , iv ) , k