Package ch.ethz.ssh2.crypto.digest

Examples of ch.ethz.ssh2.crypto.digest.HashForSSH2Types


  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    if (para.getMin_group_len() > 0)
      hash.updateUINT32(para.getMin_group_len());
    hash.updateUINT32(para.getPref_group_len());
    if (para.getMax_group_len() > 0)
      hash.updateUINT32(para.getMax_group_len());
    hash.updateBigInt(p);
    hash.updateBigInt(g);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here


  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    if (log.isEnabled())
    {
      log.log(90, "Client: '" + new String(clientversion) + "'");
      log.log(90, "Server: '" + new String(serverversion) + "'");
    }

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

      int blockSizeCS, int macLengthCS, int keyLengthSC, int blockSizeSC, int macLengthSC)
      throws IllegalArgumentException
  {
    KeyMaterial km = new KeyMaterial();

    HashForSSH2Types sh = new HashForSSH2Types(hashType);

    km.initial_iv_client_to_server = calculateKey(sh, K, H, (byte) 'A', SessionID, blockSizeCS);

    km.initial_iv_server_to_client = calculateKey(sh, K, H, (byte) 'B', SessionID, blockSizeSC);
View Full Code Here

  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    hash.updateUINT32(para.getMin_group_len());
    hash.updateUINT32(para.getPref_group_len());
    hash.updateUINT32(para.getMax_group_len());
    hash.updateBigInt(p);
    hash.updateBigInt(g);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    if (log.isEnabled())
    {
      log.log(90, "Client: '" + StringEncoder.GetString(clientversion) + "'");
      log.log(90, "Server: '" + StringEncoder.GetString(serverversion) + "'");
    }

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

      int blockSizeCS, int macLengthCS, int keyLengthSC, int blockSizeSC, int macLengthSC)
      throws IllegalArgumentException
  {
    KeyMaterial km = new KeyMaterial();

    HashForSSH2Types sh = new HashForSSH2Types(hashType);

    km.initial_iv_client_to_server = calculateKey(sh, K, H, (byte) 'A', SessionID, blockSizeCS);

    km.initial_iv_server_to_client = calculateKey(sh, K, H, (byte) 'B', SessionID, blockSizeSC);
View Full Code Here

  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    if (para.getMin_group_len() > 0)
      hash.updateUINT32(para.getMin_group_len());
    hash.updateUINT32(para.getPref_group_len());
    if (para.getMax_group_len() > 0)
      hash.updateUINT32(para.getMax_group_len());
    hash.updateBigInt(p);
    hash.updateBigInt(g);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

      int blockSizeCS, int macLengthCS, int keyLengthSC, int blockSizeSC, int macLengthSC)
      throws IllegalArgumentException
  {
    KeyMaterial km = new KeyMaterial();

    HashForSSH2Types sh = new HashForSSH2Types(hashType);

    km.initial_iv_client_to_server = calculateKey(sh, K, H, (byte) 'A', SessionID, blockSizeCS);

    km.initial_iv_server_to_client = calculateKey(sh, K, H, (byte) 'B', SessionID, blockSizeSC);
View Full Code Here

  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    if (para.getMin_group_len() > 0)
      hash.updateUINT32(para.getMin_group_len());
    hash.updateUINT32(para.getPref_group_len());
    if (para.getMax_group_len() > 0)
      hash.updateUINT32(para.getMax_group_len());
    hash.updateBigInt(p);
    hash.updateBigInt(g);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

  }

  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
      byte[] serverKexPayload, byte[] hostKey)
  {
    HashForSSH2Types hash = new HashForSSH2Types("SHA1");

    if (log.isInfoEnabled())
    {
      log.info("Client: '" + StringEncoder.GetString(clientversion) + "'");
        log.info("Server: '" + StringEncoder.GetString(serverversion) + "'");
    }

    hash.updateByteString(clientversion);
    hash.updateByteString(serverversion);
    hash.updateByteString(clientKexPayload);
    hash.updateByteString(serverKexPayload);
    hash.updateByteString(hostKey);
    hash.updateBigInt(e);
    hash.updateBigInt(f);
    hash.updateBigInt(k);

    return hash.getDigest();
  }
View Full Code Here

TOP

Related Classes of ch.ethz.ssh2.crypto.digest.HashForSSH2Types

Copyright © 2018 www.massapicom. 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.