1 Reply Latest reply: Feb 13, 2012 3:01 AM by EJP RSS

    addition of privatekey and randomnumber

    909533
      Hi..am new to java..i have generated keys using ECC..i need to add random number and secret key i.e x=r+s.here's my code..
      KeyPairGenerator kpg = KeyPairGenerator.getInstance("ECDSA", "BC");
      kpg.initialize(ecSpec, new SecureRandom());
      KeyPair keyPair = kpg.generateKeyPair();
      PublicKey pubKey = keyPair.getPublic();
      System.out.println(pubKey);
      PrivateKey privKey = keyPair.getPrivate();
      System.out.println(privKey);
      Random rand = new Random();
      int numNoRange = rand.nextInt();
      now i need to add x=numNoRange+privkey; but i couldn add it..please suggest me some ideas..Thanks..