Hello, I'm trying to make a messenger (done) that uses RSA encryption for security.
I'm using the GMP library to do the math, however when I export the number 1632 (the encrypted form of the character 'a') to a unsigned int array(just to see the value I know I need char* for the send() function of winsock), it gives me another value (2252806), The encryption works fine if I dont export the value, and I use that mpz_t variable to decrypt it.
These lines are the ones that do not work.
Code:
gmp_printf ("Value: %Zd\n", rop); //The encrypted value 1632
mpz_export(&z[i], NULL, 1, 1, 0, 0, rop); //Exports it to z which is an unsigned int array
cout << z[i]; // Prints the new exported value of z which isn't 1632 like it should
I hope you guys can help me, if you need more code plese tell me.
Thanks in advance
Federico