Package tools.elgamal

Examples of tools.elgamal.ElgamalCipher.doFinal()


    ChatterContext.put(getCk().getB(), SHARED_KEY, plainKey);
    try {
      Cipher elgamal = new ElgamalCipher();
      elgamal.init(Cipher.ENCRYPT_MODE, key);
      elgamal.update(plainKey);
      this.encryptedKey = elgamal.doFinal();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here


        PublicKeyRequest.PRIVATE_KEY);
    try {
      Cipher elgamal = new ElgamalCipher();
      elgamal.init(Cipher.DECRYPT_MODE, key);
      elgamal.update(encryptedKey);
      byte[] sharedKey = elgamal.doFinal();
      ChatterContext.put(getCk().getA(), SHARED_KEY, sharedKey);
      return new ExchSharedKeyResponse(getTo(), getFrom());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.