Package org.vngx.jsch.algorithm

Examples of org.vngx.jsch.algorithm.Random


    try {
      // Random instance for generating the kex cookie.  The 'cookie' MUST
      // be a random value generated by the sender. Its purpose is to make
      // it impossible for either side to fully determine the keys and the
      // session identifier.
      final Random random = AlgorithmManager.getManager().createAlgorithm(Algorithms.RANDOM, _session);

      // Construct the KEX INIT message packet
      // byte    SSH_MSG_KEXINIT(20)
      // byte[16]  cookie (random bytes)
      // string  kex_algorithms
      // string  server_host_key_algorithms
      // string  encryption_algorithms_client_to_server
      // string  encryption_algorithms_server_to_client
      // string  mac_algorithms_client_to_server
      // string  mac_algorithms_server_to_client
      // string  compression_algorithms_client_to_server
      // string  compression_algorithms_server_to_client
      // string  languages_client_to_server
      // string  languages_server_to_client
      // byte    boolean first_kex_packet_follows
      // uint32  0 (reserved for future extension)
      kexPacket.reset();
      kexBuffer.putByte(SSH_MSG_KEXINIT);
      random.fill(kexBuffer.getArray(), kexBuffer.getIndex(), KEX_COOKIE_LENGTH);
      kexBuffer.skip(KEX_COOKIE_LENGTH)// Move index forward
      kexBuffer.putString(_session.getConfig().getString(SessionConfig.KEX_ALGORITHMS));
      kexBuffer.putString(_session.getConfig().getString(SessionConfig.KEX_SERVER_HOST_KEY));
      kexBuffer.putString(_session.getConfig().getCiphersC2S())// Checked list of client-to-server ciphers
      kexBuffer.putString(_session.getConfig().getCiphersS2C())// Checked list of server-to-client ciphers
View Full Code Here

TOP

Related Classes of org.vngx.jsch.algorithm.Random

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.