Hi one and all.
Im doing a project on secret key protection n recovery. Im trying to implement SHAMIR's Secret scheme in java. The pblm im facing is that the secret key which can contain all types of characters(ascii values 0-127) when converted to number(integer) is having a length of more than 100 digits for 33+ characters. I cant limit my secret key to 5 or 4 characters but that kills the purpose. Im converting each character of the string into its ascii number, at the same time im making sure that each character corresponds to 3 digit integer by appending two 0's for the ascii values 0-9, a single 0 for the acsii values between 10-99. So i can club 3 digits to reconstruct the each character n finally the secret key.
But the pblm is that the number is becoming huge n i dunno how to handle it. I have to perform some arithmetic operations on that number, mainly addition. Im posting the code:
public class Project
public static long LIP(int q,long p,int degree,long despos)
public static void main(String args)
String S="6059"; // i used a small number in my pgm. Wat if the number
exceeds 100 digits?? How to perform the
long r=new long; //random numbers
int q=new int; //k known shares' numbers
long p=new long; //shares
Random R=new Random();
System.out.println(r[i]); //Coefficients of the polynomial
int b =Integer.parseInt(S);
System.out.println(b); //The secret key converted into an integer.
System.out.println("("+i+","+p[i]+")"); // n secret shares
System.out.println("The shares known are");
Please help me out. One solution can be to divide the number into different parts n to use the last parts to perform the arithmetic functions as the random numbers generated are less than 1000 n the values of n are also less than 10. So their multiplication in the polynomial will be a max of 4-5 digits.