public function encrypt($x)
    {
        $t = ''; // 16-byte block
        $y = ''; // returned cipher text;

        // put a 16-byte block into t
        $xsize = strlen($x);
        for ($i = 0; $i < $xsize; $i += 16) {
            for ($j = 0; $j < 16; ++$j) {
                // @codeCoverageIgnoreStart
                if (($i + $j) < $xsize) {
                    $t[$j] = $x[$i + $j];
                } else {
                    $t[$j] = chr(0);
                }
                // @codeCoverageIgnoreEnd
            }

            $y .= $this->encryptBlock($t);
        }

        return $y;
    }
public function encrypt($x)
    {
        $t = ''; // 16-byte block
        $y = ''; // returned cipher text;

        // put a 16-byte block into t
        $xsize = strlen($x);
        for ($i = 0; $i < $xsize; $i += 16) {
            for ($j = 0; $j < 16; ++$j) {
                // @codeCoverageIgnoreStart
                if (($i + $j) < $xsize) {
                    $t[$j] = $x[$i + $j];
                } else {
                    $t[$j] = chr(0);
                }
                // @codeCoverageIgnoreEnd
            }

            $y .= $this->encryptBlock($t);
        }

        return $y;
    }
public function encrypt ( $ x ) { $ t = '' ; // 16-byte block $ y = '' ; // returned cipher text; // put a 16-byte block into t $ xsize = strlen ( $ x ) ; for ( $ i = 0 ; $ i < $ xsize ; $ i += 16 ) { for ( $ j = 0 ; $ j < 16 ; ++ $ j ) { // @codeCoverageIgnoreStart if ( ( $ i + $ j ) < $ xsize ) { $ t [ $ j ] = $ x [ $ i + $ j ] ; } else { $ t [ $ j ] = chr ( 0 ) ; } // @codeCoverageIgnoreEnd } $ y .= $ this -> encryptBlock ( $ t ) ; } return $ y ; }
Encrypts an aribtrary length String.
@params plaintext string
@returns ciphertext string
Whenever possible you should stream your plaintext through the
encryptBlock() function directly, as the amount of time required
to encrypt is linear to the size of the ciphertext.
Encrypts an aribtrary length String .