python sjcl.decrypt help

msenoz

New member
Sep 26, 2012
35
0
0
I need to get the result of below in python, any help would be appreciated.

var myvar=sjcl.decrypt("3063", '{"iv":"/d1rF2h62VWPUELvye0ymQ","v":1,"iter":1000,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","salt":"LD0hEc22iIw","ct":"hBmJnZjyC+hbrMvoVUc"}');

demo page of (sjcl) Stanford Javascript Crypto Library below;

http://bitwiseshiftleft.github.io/sjcl/demo/
 

Rodrigo

Developer
Sep 24, 2013
393
0
16
39.108889,-76.771389
that's JSON

you can use the json lib to move this to vars.


import _json
if not 'load' in dir(_json):
import simplejson as _json



data = _json.load(response)
and then data['iv'], data['v']

it could also be you have to do data[0]['iv']
 

msenoz

New member
Sep 26, 2012
35
0
0
that's JSON

you can use the json lib to move this to vars.


import _json
if not 'load' in dir(_json):
import simplejson as _json



data = _json.load(response)
and then data['iv'], data['v']

it could also be you have to do data[0]['iv']
thanks for reply, but i need to have this eas-ccm encrypted text ("ct":"hBmJnZjyC+hbrMvoVUc") to be decrypted in python with the key ("3063").
 

msenoz

New member
Sep 26, 2012
35
0
0
You could query that link you posted there and capture the result
the page is using javascript to decrypt the text, but I don't know if there is a way to query the javascript in a page.

as per my checking there are some python libraries to decyrpt the encrypted texts
I have tried pycrypto-ccm packet but couldn't manage it.