__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
"""passlib.tests.test_handlers - tests for passlib hash algorithms"""
#=============================================================================
# imports
#=============================================================================
# core
import logging; log = logging.getLogger(__name__)
import warnings
warnings.filterwarnings("ignore", ".*using builtin scrypt backend.*")
# site
# pkg
from passlib import hash
from passlib.tests.utils import HandlerCase, TEST_MODE
from passlib.tests.test_handlers import UPASS_TABLE, PASS_TABLE_UTF8
# module

#=============================================================================
# scrypt hash
#=============================================================================
class _scrypt_test(HandlerCase):
    handler = hash.scrypt

    known_correct_hashes = [
        #
        # excepted from test vectors from scrypt whitepaper
        # (http://www.tarsnap.com/scrypt/scrypt.pdf, appendix b),
        # and encoded using passlib's custom format
        #

        # salt=b""
        ("", "$scrypt$ln=4,r=1,p=1$$d9ZXYjhleyA7GcpCwYoEl/FrSETjB0ro39/6P+3iFEI"),

        # salt=b"NaCl"
        ("password", "$scrypt$ln=10,r=8,p=16$TmFDbA$/bq+HJ00cgB4VucZDQHp/nxq18vII3gw53N2Y0s3MWI"),

        #
        # custom
        #

        # simple test
        ("test", '$scrypt$ln=8,r=8,p=1$wlhLyXmP8b53bm1NKYVQqg$mTpvG8lzuuDk+DWz8HZIB6Vum6erDuUm0As5yU+VxWA'),

        # different block value
        ("password", '$scrypt$ln=8,r=2,p=1$dO6d0xoDoLT2PofQGoNQag$g/Wf2A0vhHhaJM+addK61QPBthSmYB6uVTtQzh8CM3o'),

        # different rounds
        (UPASS_TABLE, '$scrypt$ln=7,r=8,p=1$jjGmtDamdA4BQAjBeA9BSA$OiWRHhQtpDx7M/793x6UXK14AD512jg/qNm/hkWZG4M'),

        # alt encoding
        (PASS_TABLE_UTF8, '$scrypt$ln=7,r=8,p=1$jjGmtDamdA4BQAjBeA9BSA$OiWRHhQtpDx7M/793x6UXK14AD512jg/qNm/hkWZG4M'),

        # diff block & parallel counts as well
        ("nacl", '$scrypt$ln=1,r=4,p=2$yhnD+J+Tci4lZCwFgHCuVQ$fAsEWmxSHuC0cHKMwKVFPzrQukgvK09Sj+NueTSxKds')
    ]

    if TEST_MODE("full"):
        # add some hashes with larger rounds value.
        known_correct_hashes.extend([
            #
            # from scrypt whitepaper
            #

            # salt=b"SodiumChloride"
            ("pleaseletmein", "$scrypt$ln=14,r=8,p=1$U29kaXVtQ2hsb3JpZGU"
                              "$cCO9yzr9c0hGHAbNgf046/2o+7qQT44+qbVD9lRdofI"),

            #
            # openwall format (https://gitlab.com/jas/scrypt-unix-crypt/blob/master/unix-scrypt.txt)
            #
            ("pleaseletmein",
             "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D"),

        ])

    known_malformed_hashes = [
        # missing 'p' value
        '$scrypt$ln=10,r=1$wvif8/4fg1Cq9V7L2dv73w$bJcLia1lyfQ1X2x0xflehwVXPzWIUQWWdnlGwfVzBeQ',

        # rounds too low
        '$scrypt$ln=0,r=1,p=1$wvif8/4fg1Cq9V7L2dv73w$bJcLia1lyfQ1X2x0xflehwVXPzWIUQWWdnlGwfVzBeQ',

        # invalid block size
        '$scrypt$ln=10,r=A,p=1$wvif8/4fg1Cq9V7L2dv73w$bJcLia1lyfQ1X2x0xflehwVXPzWIUQWWdnlGwfVzBeQ',

        # r*p too large
        '$scrypt$ln=10,r=134217728,p=8$wvif8/4fg1Cq9V7L2dv73w$bJcLia1lyfQ1X2x0xflehwVXPzWIUQWWdnlGwfVzBeQ',
    ]

    def setUpWarnings(self):
        super(_scrypt_test, self).setUpWarnings()
        warnings.filterwarnings("ignore", ".*using builtin scrypt backend.*")

    def populate_settings(self, kwds):
        # builtin is still just way too slow.
        if self.backend == "builtin":
            kwds.setdefault("rounds", 6)
        super(_scrypt_test, self).populate_settings(kwds)

    class FuzzHashGenerator(HandlerCase.FuzzHashGenerator):

        def random_rounds(self):
            # decrease default rounds for fuzz testing to speed up volume.
            return self.randintgauss(4, 10, 6, 1)

# create test cases for specific backends
scrypt_stdlib_test = _scrypt_test.create_backend_case("stdlib")
scrypt_scrypt_test = _scrypt_test.create_backend_case("scrypt")
scrypt_builtin_test = _scrypt_test.create_backend_case("builtin")

#=============================================================================
# eof
#=============================================================================

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 20 B 0644
__main__.py File 82 B 0644
_test_bad_register.py File 541 B 0644
backports.py File 2.53 KB 0644
sample1.cfg File 243 B 0644
sample1b.cfg File 252 B 0644
sample1c.cfg File 490 B 0644
sample_config_1s.cfg File 238 B 0644
test_apache.py File 28.75 KB 0644
test_apps.py File 5.16 KB 0644
test_context.py File 72.8 KB 0644
test_context_deprecated.py File 28.6 KB 0644
test_crypto_builtin_md4.py File 5.53 KB 0644
test_crypto_des.py File 8.67 KB 0644
test_crypto_digest.py File 20 KB 0644
test_crypto_scrypt.py File 26.02 KB 0644
test_ext_django.py File 40.4 KB 0644
test_ext_django_source.py File 10.78 KB 0644
test_handlers.py File 67.02 KB 0644
test_handlers_argon2.py File 22.3 KB 0644
test_handlers_bcrypt.py File 28.86 KB 0644
test_handlers_cisco.py File 19.99 KB 0644
test_handlers_django.py File 15.17 KB 0644
test_handlers_pbkdf2.py File 18.35 KB 0644
test_handlers_scrypt.py File 4.09 KB 0644
test_hosts.py File 3.81 KB 0644
test_pwd.py File 7.02 KB 0644
test_registry.py File 9.03 KB 0644
test_totp.py File 64.25 KB 0644
test_utils.py File 45.04 KB 0644
test_utils_handlers.py File 31.38 KB 0644
test_utils_md4.py File 1.44 KB 0644
test_utils_pbkdf2.py File 11.91 KB 0644
test_win32.py File 1.88 KB 0644
tox_support.py File 2.42 KB 0644
utils.py File 144.17 KB 0644
Filemanager