Hi all.. Am facing a problem with the primitive types ..
Am trying to develop a mini program on implementing RSA Algorithm to encrypt and decrypt files. I hav mentioned the steps what i did ..
1. I read the file content into a byte array and get those int values and do RSA encryption and get a key . 2. Now on the decryption part am using this key and generate the above int value and bring it back to char.
eg: 6 -> the ascii value to be encrypted
int encryptVal = (int)Math.pow(6,7) % 119; int decryptVal = (int)Math.pow(encryptVal ,77)%119;
but the decryptVal is not showing as 6 .. when i get it as double am getting different values .. I dont know where its going wrong .. pls help me out