Jan Altensen - 2015-06-28 04:14:13
Hello
i have a big problem, i get encrypted data from an api
i have the keys to decrypt it, my problem is that php has no function to decrypt aes with the ccm mode
on javascript you can use the sjcl library https://github.com/bitwiseshiftleft/sjcl
(
// Decrypt data.
var challengev = getCookie('challengev');
var iv = challengev.substr(16, 16);
var adata = challengev.substr(32, 16);
var derivedk = getCookie("derivedk");
var c = new sjcl.cipher.aes(sjcl.codec.hex.toBits(derivedk));
var pt = sjcl.mode.ccm.decrypt(c, sjcl.codec.hex.toBits(data), sjcl.codec.hex.toBits(iv), sjcl.codec.hex.toBits(adata));
pt = sjcl.codec.utf8String.fromBits(pt);
return pt;
)
on php i have no equivalent to decrypt it
(i want read with php some data from my router to create with rrdtool images)
has anyone a solution to derypt it?
Regards,
Stricted