!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/node-red/node_modules/bcrypt/test/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     repetitions.js (2.88 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var bcrypt = require('../bcrypt');

var EXPECTED = 2500; //number of times to iterate these tests...

module.exports = {
  test_salt_length: function(assert) {
    assert.expect(EXPECTED);
    var n = 0;
    for (var i = 0; i < EXPECTED; i++) {
      bcrypt.genSalt(10, function(err, salt) {
        assert.equals(29, salt.length, "Salt ("+salt+") isn't the correct length. It is: " + salt.length);
        n++;
      });
    }

    function checkVal() {
        if (n == EXPECTED) {
          assert.done();
        } else {
          setTimeout(checkVal, 100);
        }
    }
    setTimeout(checkVal, 100);
  },
  test_hash_length: function(assert) {
    assert.expect(EXPECTED);
    var SALT = '$2a$04$TnjywYklQbbZjdjBgBoA4e';
    var n = 0;
    for (var i = 0; i < EXPECTED; i++) {
      bcrypt.hash('test', SALT, function(err, crypted) {
        assert.equals(60, crypted.length, "Encrypted ("+crypted+") isn't the correct length. It is: " + crypted.length);
        n++;
      });
    }

    function checkVal() {
      if (n == EXPECTED) {
        assert.done();
      } else {
        setTimeout(checkVal, 100);
      }
    }
    setTimeout(checkVal, 100);
  },
  test_compare: function(assert) {
    assert.expect(EXPECTED);
    var HASH = '$2a$04$TnjywYklQbbZjdjBgBoA4e9G7RJt9blgMgsCvUvus4Iv4TENB5nHy';
    var n = 0;
    for (var i = 0; i < EXPECTED; i++) {
      bcrypt.compare('test', HASH, function(err, match) {
        assert.equal(true, match, "No match.");
        n++;
      });
    }

    function checkVal() {
      if (n == EXPECTED) {
        assert.done();
      } else {
        setTimeout(checkVal, 100);
      }
    }
    setTimeout(checkVal, 100);
  },
  test_hash_and_compare: function(assert) {
    assert.expect((EXPECTED-1)*3);
    var salt = bcrypt.genSaltSync(4),
        idx = 0,
        good_done = false,
        bad_done = false;

    function next() {
      return test('secret' + Math.random());
    }

    function test(password) {
      idx += 1;
      return bcrypt.hash(password, salt, function(err, hash) {
        if (err) throw err;
        //console.log('\nbcrypt iter ' + idx);

        assert.ok(hash);

        bcrypt.compare(password, hash, function(err, res) {
          //if (err) throw err;
          assert.ok(res);
          if (idx >= (EXPECTED-1)) {
            good_done = true;
          }
        });

        bcrypt.compare('bad' + password, hash, function(err, res) {
          //if (err) throw err;
          assert.ok(!res);
          if (idx >= (EXPECTED-1)) {
            bad_done = true;
          }
        });

        if (idx < ((EXPECTED)-1)) {
          next();
        } else {
          function checkDone() {
            if (idx >= (EXPECTED-1) && good_done && bad_done) {
              assert.done();
            } else {
              setTimeout(checkDone, 100);
            }
          }

          setTimeout(checkDone, 100);
        }
      });
    }

    next();
  }
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.004 ]--