Priviet Valery!
I am making a simple GUI project with C2 running in nw.js (I am not a programmer so C2 was the choice), the problem is that i got stuck when I need to encrypt a string (need aes encryption):
I am over a month trying it through all plugins I found for call javascript or other means, getting mad, although I read all, and tried all can simply not do it...
I wonder if you could help me to get out of this problem: I need an example of capx file that could pass a string (text to encode/decode) and a password and take the result back in C2.
the javascript I am trying to run would be something like this (in my leak of knowledge of programing was the best I could find and modify to be working in nw.js):
-------------------------------------------------------------------------------------------
function encrypt(text,parol,aes_format){
// covert to string to be used in Cipher
var aes_format = "" + aes_format
var parol = "" + parol
var cipher = crypto.createCipher(aes_format,parol)
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
return pass;
}
function decrypt(text,parol,aes_format){
// covert to string to be used in Decipher
var aes_format = "" + aes_format
var parol = "" + parol
var decipher = crypto.createDecipher(aes_format,parol)
var dec = decipher.update(text,'hex','utf8')
dec += decipher.final('utf8');
return dec;
}
// example variables
var hw = "hello world"
var hw2= "5876e13e22e45d9cc1397e0ac0658bf0"
var parol = "e7wn/S4wJ2&·ns%e7wn/S43J@3Uns%e7wn/¨92J28Uns%e7+n/S()J28U"
var aes_format = "aes-256-cbc"
// example call functions encrypt & decrypt
encrypt(hw,parol,"aes-256-cbc")
// decrypt(hw2,parol,"aes-256-cbc")
--------------------------------------------------------------------------------------------
and I really need to survive achieve in C2: call js to "encrypt(text, pass, format) and same for decrypt function" and receive results back in any variable of C2
could you help me?
thanks in advance