✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python27/lib/python2.7/site-packages/paramiko//dsskey.py
# Copyright (C) 2003-2007  Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Paramiko 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.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.

"""
DSS keys.
"""

import os
from hashlib import sha1

from Crypto.PublicKey import DSA

from paramiko import util
from paramiko.common import zero_byte
from paramiko.py3compat import long
from paramiko.ssh_exception import SSHException
from paramiko.message import Message
from paramiko.ber import BER, BERException
from paramiko.pkey import PKey


class DSSKey (PKey):
    """
    Representation of a DSS key which can be used to sign an verify SSH2
    data.
    """

    def __init__(self, msg=None, data=None, filename=None, password=None, vals=None, file_obj=None):
        self.p = None
        self.q = None
        self.g = None
        self.y = None
        self.x = None
        if file_obj is not None:
            self._from_private_key(file_obj, password)
            return
        if filename is not None:
            self._from_private_key_file(filename, password)
            return
        if (msg is None) and (data is not None):
            msg = Message(data)
        if vals is not None:
            self.p, self.q, self.g, self.y = vals
        else:
            if msg is None:
                raise SSHException('Key object may not be empty')
            if msg.get_text() != 'ssh-dss':
                raise SSHException('Invalid key')
            self.p = msg.get_mpint()
            self.q = msg.get_mpint()
            self.g = msg.get_mpint()
            self.y = msg.get_mpint()
        self.size = util.bit_length(self.p)

    def asbytes(self):
        m = Message()
        m.add_string('ssh-dss')
        m.add_mpint(self.p)
        m.add_mpint(self.q)
        m.add_mpint(self.g)
        m.add_mpint(self.y)
        return m.asbytes()

    def __str__(self):
        return self.asbytes()

    def __hash__(self):
        h = hash(self.get_name())
        h = h * 37 + hash(self.p)
        h = h * 37 + hash(self.q)
        h = h * 37 + hash(self.g)
        h = h * 37 + hash(self.y)
        # h might be a long by now...
        return hash(h)

    def get_name(self):
        return 'ssh-dss'

    def get_bits(self):
        return self.size

    def can_sign(self):
        return self.x is not None

    def sign_ssh_data(self, data):
        digest = sha1(data).digest()
        dss = DSA.construct((long(self.y), long(self.g), long(self.p), long(self.q), long(self.x)))
        # generate a suitable k
        qsize = len(util.deflate_long(self.q, 0))
        while True:
            k = util.inflate_long(os.urandom(qsize), 1)
            if (k > 2) and (k < self.q):
                break
        r, s = dss.sign(util.inflate_long(digest, 1), k)
        m = Message()
        m.add_string('ssh-dss')
        # apparently, in rare cases, r or s may be shorter than 20 bytes!
        rstr = util.deflate_long(r, 0)
        sstr = util.deflate_long(s, 0)
        if len(rstr) < 20:
            rstr = zero_byte * (20 - len(rstr)) + rstr
        if len(sstr) < 20:
            sstr = zero_byte * (20 - len(sstr)) + sstr
        m.add_string(rstr + sstr)
        return m

    def verify_ssh_sig(self, data, msg):
        if len(msg.asbytes()) == 40:
            # spies.com bug: signature has no header
            sig = msg.asbytes()
        else:
            kind = msg.get_text()
            if kind != 'ssh-dss':
                return 0
            sig = msg.get_binary()

        # pull out (r, s) which are NOT encoded as mpints
        sigR = util.inflate_long(sig[:20], 1)
        sigS = util.inflate_long(sig[20:], 1)
        sigM = util.inflate_long(sha1(data).digest(), 1)

        dss = DSA.construct((long(self.y), long(self.g), long(self.p), long(self.q)))
        return dss.verify(sigM, (sigR, sigS))

    def _encode_key(self):
        if self.x is None:
            raise SSHException('Not enough key information')
        keylist = [0, self.p, self.q, self.g, self.y, self.x]
        try:
            b = BER()
            b.encode(keylist)
        except BERException:
            raise SSHException('Unable to create ber encoding of key')
        return b.asbytes()

    def write_private_key_file(self, filename, password=None):
        self._write_private_key_file('DSA', filename, self._encode_key(), password)

    def write_private_key(self, file_obj, password=None):
        self._write_private_key('DSA', file_obj, self._encode_key(), password)

    @staticmethod
    def generate(bits=1024, progress_func=None):
        """
        Generate a new private DSS key.  This factory function can be used to
        generate a new host key or authentication key.

        :param int bits: number of bits the generated key should be.
        :param function progress_func:
            an optional function to call at key points in key generation (used
            by ``pyCrypto.PublicKey``).
        :return: new `.DSSKey` private key
        """
        dsa = DSA.generate(bits, os.urandom, progress_func)
        key = DSSKey(vals=(dsa.p, dsa.q, dsa.g, dsa.y))
        key.x = dsa.x
        return key

    ###  internals...

    def _from_private_key_file(self, filename, password):
        data = self._read_private_key_file('DSA', filename, password)
        self._decode_key(data)

    def _from_private_key(self, file_obj, password):
        data = self._read_private_key('DSA', file_obj, password)
        self._decode_key(data)

    def _decode_key(self, data):
        # private key file contains:
        # DSAPrivateKey = { version = 0, p, q, g, y, x }
        try:
            keylist = BER(data).decode()
        except BERException as e:
            raise SSHException('Unable to parse key file: ' + str(e))
        if (type(keylist) is not list) or (len(keylist) < 6) or (keylist[0] != 0):
            raise SSHException('not a valid DSA private key file (bad ber encoding)')
        self.p = keylist[1]
        self.q = keylist[2]
        self.g = keylist[3]
        self.y = keylist[4]
        self.x = keylist[5]
        self.size = util.bit_length(self.p)


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
8 Jan 2025 10.42 AM
root / linksafe
0755
__init__.py
3.83 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
__init__.pyc
3.706 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
__init__.pyo
3.706 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
_version.py
0.079 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
_version.pyc
0.276 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
_version.pyo
0.276 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
_winapi.py
10.443 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
_winapi.pyc
11.785 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
_winapi.pyo
11.646 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
agent.py
12.291 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
agent.pyc
16.379 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
agent.pyo
16.379 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
auth_handler.py
26.029 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
auth_handler.pyc
18.373 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
auth_handler.pyo
18.373 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ber.py
4.16 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
ber.pyc
4.263 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ber.pyo
4.263 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
buffered_pipe.py
6.833 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
buffered_pipe.pyc
7.102 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
buffered_pipe.pyo
7.102 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
channel.py
44.677 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
channel.pyc
46.097 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
channel.pyo
46.019 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
client.py
26.235 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
client.pyc
22.772 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
client.pyo
22.772 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
common.py
7.376 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
common.pyc
5.951 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
common.pyo
5.951 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
compress.py
1.216 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
compress.pyc
1.521 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
compress.pyo
1.521 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
config.py
10.736 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
config.pyc
7.688 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
config.pyo
7.688 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
dsskey.py
6.599 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
dsskey.pyc
7.519 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
dsskey.pyo
7.519 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ecdsakey.py
6.069 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
ecdsakey.pyc
7.067 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ecdsakey.pyo
7.067 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
file.py
17.663 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
file.pyc
14.865 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
file.pyo
14.865 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
hostkeys.py
12.057 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
hostkeys.pyc
13.93 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
hostkeys.pyo
13.875 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_gex.py
9.673 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
kex_gex.pyc
7.881 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_gex.pyo
7.881 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_group1.py
5.419 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
kex_group1.pyc
4.651 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_group1.pyo
4.651 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_group14.py
1.669 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
kex_group14.pyc
1.021 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_group14.pyo
1.021 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_gss.py
24.281 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
kex_gss.pyc
19.813 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
kex_gss.pyo
19.813 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
message.py
9.292 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
message.pyc
12.07 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
message.pyo
12.07 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
packet.py
18.889 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
packet.pyc
16.156 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
packet.pyo
16.156 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
pipe.py
3.911 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
pipe.pyc
5.641 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
pipe.pyo
5.641 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
pkey.py
13.626 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
pkey.pyc
14.487 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
pkey.pyo
14.487 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
primes.py
4.833 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
primes.pyc
3.448 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
primes.pyo
3.448 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
proxy.py
4.177 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
proxy.pyc
3.731 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
proxy.pyo
3.731 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
py3compat.py
3.869 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
py3compat.pyc
5.86 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
py3compat.pyo
5.772 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
resource.py
2.487 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
resource.pyc
2.277 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
resource.pyo
2.277 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
rsakey.py
6.461 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
rsakey.pyc
7.546 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
rsakey.pyo
7.546 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
server.py
29.379 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
server.pyc
32.017 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
server.pyo
32.017 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp.py
6.061 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp.pyc
5.8 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp.pyo
5.8 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_attr.py
7.699 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_attr.pyc
7.097 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_attr.pyo
7.097 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_client.py
31.468 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_client.pyc
32.005 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_client.pyo
32.005 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_file.py
19.52 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_file.pyc
19.357 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_file.pyo
19.357 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_handle.py
7.344 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_handle.pyc
7.587 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_handle.pyo
7.587 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_server.py
18.001 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_server.pyc
14.404 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_server.pyo
14.404 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_si.py
11.652 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
sftp_si.pyc
12.723 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
sftp_si.pyo
12.723 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ssh_exception.py
6.034 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
ssh_exception.pyc
7.335 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ssh_exception.pyo
7.335 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ssh_gss.py
21.83 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
ssh_gss.pyc
20.288 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
ssh_gss.pyo
20.288 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
transport.py
99.813 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
transport.pyc
89.032 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
transport.pyo
89.032 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
util.py
9.503 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
util.pyc
11.708 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
util.pyo
11.708 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
win_pageant.py
4.111 KB
29 Apr 2016 4.58 AM
root / linksafe
0644
win_pageant.pyc
4.328 KB
22 Oct 2019 1.53 AM
root / linksafe
0644
win_pageant.pyo
4.328 KB
22 Oct 2019 1.53 AM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF