Encryption of a class in C #

0

I have the following code in PHP:

    $params = json_decode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $api_secret, base64_decode($enc_request), MCRYPT_MODE_ECB)));

Where the result is an array and not a string.

My data I need to send is these:

Dados dados = new Dados ();

dados.Controller = "Get";
dados.Action = "FindIdUsuario_get";
dados.Email = "[email protected]";
dados.Pass = "teste";

How do I encrypt these classes using Rijndael to send to my url?

UPDATE

Here is the encryption code I use in php:

$request_params = array();
$request_params['controller'] = 'Get';
$request_params['action'] = 'FindIdUsuario_get';
$request_params['email'] = '[email protected]';
$request_params['pass'] = 'teste';
echo base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $public_key, json_encode($request_params), MCRYPT_MODE_ECB));
    
asked by anonymous 29.12.2015 / 16:15

1 answer

0

Classes are data sets. Basically (and totally roughly) it's a structure. You could even manipulate at low level and encrypt this class, but from this done, the VM will no longer recognize this class and will delete it from memory.

If you want to hide ALL the data of this class, you have to apply encryption to each field of the same, since under the cloths this data will be sequential and there will not be this beautiful and readable division that we see at the time of programming, Class "fully encrypted.

To submit this URL yourself, simply arrange it into a larger string, encrypt this string, and pass. Another VERY BEST method is by Post (form).

    
29.12.2015 / 16:58