Posts: 300
Joined: Mar 2008
Reputation:
14
I'm trying to compute a sha256 hash, but as you may know hashlib isn't available with the current python version in XBMC.
However, I see that cryptoPy is an addon module, but I can't find any documentation as to what it supports and how to use it. I've been round the houses without luck, and it's given me an actual headache!!
Anyone here know anything?
Posts: 300
Joined: Mar 2008
Reputation:
14
Thanks. I had a look through and it looks good, but I'm worried about the cross-platform aspect. Does your plugin only run on windows?
Posts: 300
Joined: Mar 2008
Reputation:
14
2011-02-18, 00:27
(This post was last modified: 2011-02-18, 00:49 by hippojay.)
Woops, what I actually needed was tha HMAC from a sha256. So whilst sha256.py works, it doesn't work when creating a new hmac :-(
so doing this:
dig=hmac.new(privateKey, msg, digestmod=sha256).hexdigest()
gives me this:
AttributeError: 'module' object has no attribute 'digest_size'
Back to the drawingboard
EDIT: forget that - I just fallen in love with python. Took a copy of hmac.py, hardcoded a few things for sha256 and it works!! Not the best way to do it, but a definate work around until XBMC moves to something a little more current.