Closed GoogleCodeExporter closed 8 years ago
w wersji mobile:
def generateToken(self, url):
url = url.replace('http://redir.atmcdn.pl/http/','')
SecretKey = 'AB9843DSAIUDHW87Y3874Q903409QEWA'
iv = 'ab5ef983454a21bd'
KeyStr = '0f12f35aa0c542e45926c43a39ee2a7b38ec2f26975c00a30e1292f7e137e120e5ae9d1cfe10dd682834e3754efc1733'
salt = sha1()
salt.update(os.urandom(16))
salt = salt.hexdigest()[:32]
tvncrypt = crypto.cipher.aes_cbc.AES_CBC(SecretKey, padding=crypto.cipher.base.noPadding(), keySize=32)
key = tvncrypt.decrypt(binascii.unhexlify(KeyStr), iv=iv)[:32]
expire = 3600000L + long(time.time()*1000) - 946684800000L
unencryptedToken = "name=%s&expire=%s\0" % (url, expire)
pkcs5_pad = lambda s: s + (16 - len(s) % 16) * chr(16 - len(s) % 16)
pkcs5_unpad = lambda s : s[0:-ord(s[-1])]
unencryptedToken = pkcs5_pad(unencryptedToken)
tvncrypt = crypto.cipher.aes_cbc.AES_CBC(binascii.unhexlify(key), padding=crypto.cipher.base.noPadding(), keySize=16)
encryptedToken = tvncrypt.encrypt(unencryptedToken, iv=binascii.unhexlify(salt))
encryptedTokenHEX = binascii.hexlify(encryptedToken).upper()
return "http://redir.atmcdn.pl/http/%s?salt=%s&token=%s" % (url, salt, encryptedTokenHEX)
a w wersji tv samsung jest to pobierane ze strumienia.
Original comment by ples...@gmail.com
on 30 Oct 2012 at 11:02
zamykam issue
Original comment by jatrn69
on 7 Dec 2012 at 10:15
Original issue reported on code.google.com by
aniamens...@gmail.com
on 28 Oct 2012 at 7:29