New To Java - Converting a BigInteger to a String of words using some rules
After decrypting something I have a huge BigInteger and now I want to convert it to letters with some rules like these : 01 : A; 02 : B; 03 : C;...;27 : [space];28 : [.];31 : [']How would you do that?
[222 byte] By [
Hydexa] at [2007-11-26 23:31:24]

I don't see any methods that let you directly access the decimal digits of a BigInteger,
but you can always turn it into a decimal string and anaylse the string. Why are you doing this?
I ask, because if the character choices in your
map are flexible, you can use the toString method that takes a radix:
import java.math.BigInteger;public class BigIntegerExample {
public static void main(String[] args) {
BigInteger x = new BigInteger("123456789012345678901234567890");
String s = x.toString(36); //base 36
System.out.println(s);
}
}
It's a cryptanalysis exercise, I did decrypt something into decimal digits, now I have to turn it to letters : )So I have no choice about the rules...
Hydexa at 2007-7-10 14:43:10 >

Well, I don't have the original string, I have to compute with some numbers (namely, I decrypt an RSA code to prove it is insecure with low public exponent), so I have to do quite a number of calculations and BigInteger is mandatory for that...
Hydexa at 2007-7-10 14:43:10 >
