1 Reply Latest reply on Feb 13, 2012 9:01 AM by EJP

    addition of privatekey and randomnumber

      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();
      PrivateKey privKey = keyPair.getPrivate();
      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..