I decrypted a data and got a BigInt and when I tried to convert it to string I got some Wired characters.
Code for getting BigInteger
BigInteger dec = process.Decrypt(sec);
Code for getting ByteArray
byte testBy[] = dec.toByteArray();
Code for Converting into String
String ss = new String(testBy);
System.out.println(ss);
and I tried this code too
String ss = new String(testBy);
System.out.println(ss, "UTF8");
I'm getting this output
=^ö½ß‡k+Éæ‚ûŽ3B‚+…Òæ?&¶?kÛUô—c
Help me out here..
println(String, String)method. Also,String ss = new String(testBy, "UTF-8");would be acceptable.process.Decrypt? Sure it returns aBigInteger, but if it is supposed to hold aStringwe will need more information about how this method actually stores data inside theBigInteger. Check its API documentation.