NetSieben Secure Shell C++ Library-开源

  • j8_547007
    了解作者
  • 460.6KB
    文件大小
  • 文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-08 05:55
    上传日期
NetSieben SSH Library 是用 C++ 编写的 Secure Shell 客户端软件。 它利用 Botan 库实现加密功能,允许在 SSH 通信中使用大量算法选择。
ne7ssh-1.03.tar.gz
  • ne7ssh-1.03
  • src
  • ne7ssh.cpp
    9.4KB
  • crypt.cpp
    15.7KB
  • ne7ssh_transport.cpp
    8.1KB
  • ne7ssh_channel.cpp
    8.8KB
  • ne7ssh_connection.cpp
    4.3KB
  • Makefile.am
    502B
  • ne7ssh_channel.h
    5.9KB
  • ne7ssh_string.h
    5.6KB
  • socket.cpp
    2.1KB
  • ne7ssh_string.cpp
    4.3KB
  • ne7ssh_types.h
    1.6KB
  • crypt.h
    13.2KB
  • ne7ssh.h
    7.9KB
  • ne7ssh_connection.h
    5.2KB
  • ne7ssh_transport.h
    5KB
  • ne7ssh_session.h
    3.7KB
  • ne7ssh_kex.cpp
    8.5KB
  • ne7ssh_kex.h
    3.5KB
  • Makefile.in
    16.4KB
  • ne7ssh_session.cpp
    1.1KB
  • error.h
    4.2KB
  • socket.h
    2KB
  • doc
  • xml
  • dir_000003.xml
    1.8KB
  • classne7ssh.xml
    40.2KB
  • ne7ssh_8h.xml
    47.6KB
  • ne7ssh__channel_8h.xml
    16.8KB
  • combine.xslt
    646B
  • socket_8h.xml
    15.9KB
  • ne7ssh_8cpp.xml
    70.6KB
  • namespaceBotan.xml
    480B
  • ne7ssh__connection_8cpp.xml
    39.2KB
  • index.xsd
    2.3KB
  • namespacestd.xml
    477B
  • ne7ssh__types_8h.xml
    18.4KB
  • classLogInfo.xml
    12.5KB
  • classne7ssh__transport.xml
    23.5KB
  • dir_000001.xml
    592B
  • config_8h.xml
    19KB
  • ne7ssh__connection_8h.xml
    23.6KB
  • dir_000000.xml
    507B
  • crypt_8cpp.xml
    123.6KB
  • error_8h.xml
    15.8KB
  • classne7ssh__string.xml
    29.2KB
  • ne7ssh__transport_8cpp.xml
    63.4KB
  • classne7ssh__session.xml
    23.3KB
  • classLogError.xml
    5KB
  • classne7Sock.xml
    10KB
  • compound.xsd
    31KB
  • dir_000002.xml
    526B
  • crypt_8h.xml
    31.3KB
  • index.xml
    31.7KB
  • classne7ssh__kex.xml
    19.5KB
  • ne7ssh__string_8h.xml
    18.1KB
  • ne7ssh__channel_8cpp.xml
    66.3KB
  • ne7ssh__session_8cpp.xml
    11.5KB
  • namespaceGlobal__RNG.xml
    498B
  • ne7ssh__kex_8cpp.xml
    67.8KB
  • ne7ssh__kex_8h.xml
    17.9KB
  • classne7ssh__channel.xml
    34KB
  • ne7ssh__string_8cpp.xml
    36KB
  • ne7ssh__transport_8h.xml
    22.5KB
  • structcypherkey.xml
    1.4KB
  • classne7ssh__crypt.xml
    75.9KB
  • classne7ssh__connection.xml
    30KB
  • socket_8cpp.xml
    18.9KB
  • ne7ssh__session_8h.xml
    20.6KB
  • html
  • files.html
    2.5KB
  • ne7ssh__transport_8h-source.html
    7.7KB
  • classne7ssh__crypt.html
    45KB
  • classne7ssh__channel.html
    14.6KB
  • index.html
    963B
  • classne7ssh__string.html
    29.1KB
  • classne7ssh__crypt-members.html
    7.1KB
  • classne7ssh__kex-members.html
    2.3KB
  • classLogInfo.html
    14.8KB
  • config_8h-source.html
    5.9KB
  • dirs.html
    1.2KB
  • ne7ssh_8h-source.html
    14.4KB
  • error_8h-source.html
    7.5KB
  • ne7ssh__types_8h-source.html
    6.4KB
  • ne7ssh__string_8h-source.html
    8.3KB
  • classne7ssh__connection.html
    18KB
  • doxygen.png
    1.3KB
  • ne7ssh__connection_8h-source.html
    9KB
  • dir_000003.html
    4.7KB
  • classne7Sock-members.html
    2.5KB
  • socket_8h-source.html
    5.6KB
  • dir_000000.html
    1.3KB
  • classne7ssh__session-members.html
    4.5KB
  • classne7ssh.html
    29.2KB
  • classne7ssh__session.html
    19.2KB
  • annotated.html
    2.3KB
  • ne7ssh__kex_8h-source.html
    6.4KB
  • classLogError-members.html
    1.6KB
  • classne7Sock.html
    10.9KB
内容介绍
/*************************************************************************** * Copyright (C) 2005 by NetSieben Technologies Pty Limited * * Author: Andrew Useckas * * Email: andrew@netsieben.com * * * * This program may be distributed under the terms of the Q Public * * License as defined by Trolltech AS of Norway and appearing in the * * file LICENSE.QPL included in the packaging of this file. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * ***************************************************************************/ #include "crypt.h" #include "ne7ssh_session.h" ne7ssh_crypt::ne7ssh_crypt(ne7ssh_session* _session) : session(_session), inited(false), encrypt(0), decrypt(0), compress(0), decompress(0), hmacOut(0), hmacIn(0), privKexKey(0), encryptBlock(0), decryptBlock(0) { } ne7ssh_crypt::~ne7ssh_crypt() { if (encrypt) delete encrypt; if (decrypt) delete decrypt; if (compress) delete compress; if (decompress) delete decompress; if (hmacOut) delete hmacOut; if (hmacIn) delete hmacIn; if (privKexKey) delete privKexKey; } bool ne7ssh_crypt::agree (SecureVector<byte> &result, const char* local, SecureVector<byte> &remote) { ne7ssh_string localAlgos (local, 0); ne7ssh_string remoteAlgos (remote, 0); char* localAlgo, *remoteAlgo; bool match; uint32 len; localAlgos.split (','); localAlgos.resetParts(); remoteAlgos.split (','); remoteAlgos.resetParts(); match = false; while ((localAlgo = localAlgos.nextPart())) { len = strlen(localAlgo); while ((remoteAlgo = remoteAlgos.nextPart())) { if (!memcmp (localAlgo, remoteAlgo, len)) { match = true; break; } } if (match) break; remoteAlgos.resetParts(); } if (match) { result.set ((byte*)localAlgo, len); return true; } else { result.clear(); return false; } } bool ne7ssh_crypt::negotiatedKex (SecureVector<byte> &kexAlgo) { if (!memcmp (kexAlgo.begin(), "diffie-hellman-group1-sha1", kexAlgo.size())) { kexMethod = DH_GROUP1_SHA1; return true; } ne7ssh::throwError ("KEX method not defined!", (char*)kexAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedHostkey (SecureVector<byte> &hostkeyAlgo) { if (!memcmp (hostkeyAlgo.begin(), "ssh-dss", hostkeyAlgo.size())) { hostkeyMethod = SSH_DSS; return true; } ne7ssh::throwError ("Host Key method not defined!", (char*)hostkeyAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedCryptoC2s (SecureVector<byte> &cryptoAlgo) { if (!memcmp (cryptoAlgo.begin(), "3des-cbc", cryptoAlgo.size())) { c2sCryptoMethod = TDES_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "aes128-cbc", cryptoAlgo.size())) { c2sCryptoMethod = AES128_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "aes256-cbc", cryptoAlgo.size())) { c2sCryptoMethod = AES256_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "blowfish-cbc", cryptoAlgo.size())) { c2sCryptoMethod = BLOWFISH_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "cast128-cbc", cryptoAlgo.size())) { c2sCryptoMethod = CAST128_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "twofish-cbc", cryptoAlgo.size()) || !memcmp (cryptoAlgo.begin(), "twofish256-cbc", cryptoAlgo.size())) { c2sCryptoMethod = TWOFISH_CBC; return true; } ne7ssh::throwError ("Crypto method not defined!", (char*)cryptoAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedCryptoS2c (SecureVector<byte> &cryptoAlgo) { if (!memcmp (cryptoAlgo.begin(), "3des-cbc", cryptoAlgo.size())) { s2cCryptoMethod = TDES_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "aes128-cbc", cryptoAlgo.size())) { s2cCryptoMethod = AES128_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "aes256-cbc", cryptoAlgo.size())) { s2cCryptoMethod = AES256_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "blowfish-cbc", cryptoAlgo.size())) { s2cCryptoMethod = BLOWFISH_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "cast128-cbc", cryptoAlgo.size())) { s2cCryptoMethod = CAST128_CBC; return true; } else if (!memcmp (cryptoAlgo.begin(), "twofish-cbc", cryptoAlgo.size()) || !memcmp (cryptoAlgo.begin(), "twofish256-cbc", cryptoAlgo.size())) { s2cCryptoMethod = TWOFISH_CBC; return true; } ne7ssh::throwError ("Crypto method not defined!", (char*)cryptoAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedMacC2s (SecureVector<byte> &macAlgo) { if (!memcmp (macAlgo.begin(), "hmac-sha1", macAlgo.size())) { c2sMacMethod = HMAC_SHA1; return true; } else if (!memcmp (macAlgo.begin(), "hmac-md5", macAlgo.size())) { c2sMacMethod = HMAC_MD5; return true; } else if (!memcmp (macAlgo.begin(), "none", macAlgo.size())) { c2sMacMethod = HMAC_NONE; return true; } ne7ssh::throwError ("Mac method not defined!", (char*)macAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedMacS2c (SecureVector<byte> &macAlgo) { if (!memcmp (macAlgo.begin(), "hmac-sha1", macAlgo.size())) { s2cMacMethod = HMAC_SHA1; return true; } else if (!memcmp (macAlgo.begin(), "hmac-md5", macAlgo.size())) { s2cMacMethod = HMAC_MD5; return true; } else if (!memcmp (macAlgo.begin(), "none", macAlgo.size())) { s2cMacMethod = HMAC_NONE; return true; } ne7ssh::throwError ("Mac method not defined!", (char*)macAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedCmprsC2s (SecureVector<byte> &cmprsAlgo) { if (!memcmp (cmprsAlgo.begin(), "none", cmprsAlgo.size())) { c2sCmprsMethod = NONE; return true; } else if (!memcmp (cmprsAlgo.begin(), "zlib", cmprsAlgo.size())) { c2sCmprsMethod = ZLIB; return true; } ne7ssh::throwError ("Compression method not defined!", (char*)cmprsAlgo.begin()); return false; } bool ne7ssh_crypt::negotiatedCmprsS2c (SecureVector<byte> &cmprsAlgo) { if (!memcmp (cmprsAlgo.begin(), "none", cmprsAlgo.size())) { s2cCmprsMethod = NONE; return true; } else if (!memcmp (cmprsAlgo.begin(), "zlib", cmprsAlgo.size())) { s2cCmprsMethod = ZLIB; return true; } ne7ssh::throwError ("Compression method not defined!", (char*)cmprsAlgo.begin()); return false; } bool ne7ssh_crypt::getKexPublic (BigInt &publicKey) { switch (kexMethod) { case DH_GROUP1_SHA1: return getDHGroup1Sha1Public (publicKey); default: ne7ssh::throwError ("Undefined DH Group", kexMethod); return false; } } bool ne7ssh_crypt::computeH (SecureVector<byte> &result, SecureVector<byte> &val) { HashFunction* hashIt; switch (kexMethod) { case DH_GROUP1_SHA1: hashIt = get_hash ("SHA-1"); break; default: ne7ssh::throwError ("Undefined DH Group in computeH", kexMethod); return false; } if (!hashIt) return false; H = hashIt->process (val); result.set (H); return true; } bool ne7ssh_crypt::verifySig (SecureVector<byte> &hostKey, SecureVector<byte> &sig) { DSA_PublicKey *dsaKey = 0; PK_Verifier *verifier; ne7ssh_string signature (sig, 0); SecureVector<byte> sigType, sigData; bool result; if (H.is_empty()) { ne7ssh::throwError ("H not initialized"); return false; } if (!signature.getString (sigType)) { ne7ssh::throwError ("Signature has no type");
评论
    相关推荐
    • ssh 上传下载
      ssh框架下基于java技术实现的文件上传下载功能!
    • SSH连接Token2Shell5.4.1
      Token2Shell支持SSH连接广泛的运算法则和连接方式。它支持的协议有ab://、ssh://、telnet://、tcp://、com://、phone://等。
    • sshengine:一个可以帮助我了解SSH加密和连接过程的项目
      安全外壳(SSH)身份验证协议RFC 4254-安全外壳(SSH)连接协议RFC 4419-用于安全Shell(SSH)传输层协议的Diffie-Hellman组交换RFC 5480-椭圆曲线密码学主题公钥信息RFC 5656-安全外壳传输层中的椭圆曲线算法集成
    • ssh-nile-开源
      通过SSH传播的N阶段蠕虫。 它在给定的主机列表中执行命令,并使用rsync将文件复制到其中。 其传播到集群的路径是可配置的。 凭借其自适应算法,它提供了可扩展/可靠的传输API
    • sshbatch:SSH协议
      SSH :: Batch-基于并行SSH,设置和间隔算法的集群操作 目录 版本 本文档介绍了2015年11月8日发布的SSH :: Batch 0.030。 概要 提供了以下脚本: 前节点 将模式扩展到计算机主机列表。 $ cat > ~/.fornodesrc ps=...
    • SSH框架Demo
      自己写的SSH框架,备份用。需要的兄弟们也可以下载参考。前台用的bootstrap
    • ssh客户端putty
      Putty是一个免费的、Windows 32平台下的telnet、rlogin和ssh客户端,
    • KochsAlgorithm:基于Koch算法的雪花建模程序
      Program9JamesShockley 基于Koch算法的雪花建模程序
    • SSH-Randomart:从md5或sha256指纹创建与SSH相同的randomart的模块
      生成SSH randomart 从SHA256或MD5指纹创建randomart的模块。 randomart与来自OpenSSH的randomart相同。 这个模块是用酒醉的毕晓普算法来构建randomart的。 详细的脱臼可以在这里找到: : 例子 SHA256 默认情况下...