public static String decrypt(String code,BigInteger n, BigInteger d)
{
    String t=new String("");
    String binary[]=new String[1000000],msg1=new String("");
    BigInteger decry[]=new BigInteger[1000000];
    BigInteger encry[]=new BigInteger[1000000];
    int j=-1;
    for(int i=0;i<code.length();i++)
    {if(i%4==0) {j++;binary[j]="";}
     t=Long.toBinaryString((long)(code.charAt(i)));
     for(int k=t.length();k<8;k++) t="0"+t;
        binary[j]=binary[j]+t;
    }
   // System.out.println("j is"+j);
    for(int i=0;i<=j;i++)
    {
        int a=5;
        if(binary[i].equals("")) break;
        //System.out.println("Binary is::"+binary[i]);

        BigInteger t1=new BigInteger(binary[i],10);
        encry[i]=toDecimal(t1);
        decry[i]=encry[i].modPow(d,n);
        //System.out.println("hee hee"+encry[i]+"\t\t"+decry[i]);
        binary[i]=Long.toBinaryString(decry[i].longValue());
         for(int pp=binary[i].length();pp<32;pp++) binary[i]="0"+binary[i];
        //System.out.println("Binary is:"+binary[i]);
        for(int k=0;k<25;k+=8)
        { if(binary[i].substring(k,k+8).equals("00000000"))
              continue;
          msg1+=(char)Integer.parseInt(binary[i].substring(k, k+8),2);

    }
    //System.out.println("whoosh::::"+msg);
}

    return msg1;

}