!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/siu/security-multitool/tests/SecurityMultiTool/Random/   drwxrwxr-x
Free 15.6 GB of 61.93 GB (25.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     GeneratorTest.php (4.93 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * SecurityMultiTool
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://github.com/padraic/SecurityMultiTool/blob/master/LICENSE
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to padraic@php.net so we can send you a copy immediately.
 *
 * @category   SecurityMultiTool
 * @package    SecurityMultiTool
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2013 Pádraic Brady (http://blog.astrumfutura.com)
 * @license    http://github.com/padraic/SecurityMultiTool/blob/master/LICENSE New BSD License
 */

use SecurityMultiTool\Random\Generator;
use 
SecurityMultiTool\Random\Source;
use 
Mockery as M;

class 
GeneratorTest extends \PHPUnit_Framework_TestCase
{

    public function 
setup()
    {
        
$this->rand = new Generator;
    }

    public static function 
provideRandInt()
    {
        return array(
            array(
21100001000.91.1false),
            array(
21100001000.81.2true)
        );
    }

    public function 
testRandBytes()
    {
        for (
$length 1$length 4096$length++) {
            
$rand $this->rand->getBytes($length);
            
$this->assertTrue($rand !== false);
            
$this->assertEquals($lengthstrlen($rand));
        }
    }

    public function 
testRandBoolean()
    {
        for (
$length 1$length 512$length++) {
            
$rand $this->rand->getBoolean();
            
$this->assertTrue(is_bool($rand));
        }
    }

    
/**
     * A Monte Carlo test that generates $cycles numbers from 0 to $tot
     * and test if the numbers are above or below the line y=x with a
     * frequency range of [$min, $max]
     *
     * Note: this code is inspired by the random number generator test
     * included in the PHP-CryptLib project of Anthony Ferrara
     * @see https://github.com/ircmaxell/PHP-CryptLib
     *
     * @dataProvider provideRandInt
     */
    
public function testRandInteger($num$valid$cycles$tot$min$max$strong)
    {
        try {
            
$test $this->rand->getBytes(1$strong);
        } catch (\
RuntimeException $e) {
            
$this->markTestSkipped($e->getMessage());
        }

        
$i     0;
        
$count 0;
        do {
            
$up   0;
            
$down 0;
            for (
$i 0$i $cycles$i++) {
                
$x $this->rand->getInteger(0$tot$strong);
                
$y $this->rand->getInteger(0$tot$strong);
                if (
$x $y) {
                    
$up++;
                } elseif (
$x $y) {
                    
$down++;
                }
            }
            
$this->assertGreaterThan(0$up);
            
$this->assertGreaterThan(0$down);
            
$ratio $up $down;
            if (
$ratio $min && $ratio $max) {
                
$count++;
            }
            
$i++;
        } while (
$i $num && $count $valid);

        if (
$count $valid) {
            
$this->fail('The random number generator failed the Monte Carlo test');
        }
    }

    public function 
testIntegerRangeFail()
    {
        
$this->setExpectedException(
            
'\DomainException'
        
);
        
$rand $this->rand->getInteger(1000);
    }

    public function 
testRandFloat()
    {
        for (
$length 1$length 512$length++) {
            
$rand $this->rand->getFloat();
            
$this->assertTrue(is_float($rand));
            
$this->assertTrue(($rand >= && $rand <= 1));
        }
    }

    public function 
testGetString()
    {
        for (
$length 1$length 512$length++) {
            
$rand $this->rand->getString($length'0123456789abcdef');
            
$this->assertEquals(strlen($rand), $length);
            
$this->assertTrue(preg_match('#^[0-9a-f]+$#'$rand) === 1);
        }
    }

    public function 
testGetStringBase64()
    {
        for (
$length 1$length 512$length++) {
            
$rand $this->rand->getString($length);
            
$this->assertEquals(strlen($rand), $length);
            
$this->assertTrue(preg_match('#^[0-9a-zA-Z+/]+$#'$rand) === 1);
        }
    }

    public function 
testHashTimingSourceStrengthIsVeryLow()
    {
        
$this->assertEquals(1, (string) Source\HashTiming::getStrength());
    }

    public function 
testHashTimingSourceStrengthIsRandomWithCorrectLength()
    {
        
$source = new Source\HashTiming;
        
$rand $source->generate(32);
        
$this->assertTrue(32 === strlen($rand));
        
$rand2 $source->generate(32);
        
$this->assertNotEquals($rand$rand2);
    }

    public function 
testAltGeneratorIsRandomWithCorrectLength()
    {
        
$source $this->rand->getAlternativeGenerator();
        
$rand $source->generate(32);
        
$this->assertTrue(32 === strlen($rand));
        
$rand2 $source->generate(32);
        
$this->assertNotEquals($rand$rand2);
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.3147 ]--