src/sb/Encryption/ForTransmission.php
public function encrypt($string)
    {
        $td = mcrypt_module_open($this->cypher, '', $this->mode, '');
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), mcrypt_RAND);
        mcrypt_generic_init($td, $this->key, $iv);
        $encrypted = mcrypt_generic($td, $string);
        mcrypt_generic_deinit($td);

        return $iv.$encrypted;
    }
public function encrypt($string)
    {
        $td = mcrypt_module_open($this->cypher, '', $this->mode, '');
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), mcrypt_RAND);
        mcrypt_generic_init($td, $this->key, $iv);
        $encrypted = mcrypt_generic($td, $string);
        mcrypt_generic_deinit($td);

        return $iv.$encrypted;
    }
public function encrypt ( $ string ) { $ td = mcrypt_module_open ( $ this -> cypher , '' , $ this -> mode , '' ) ; $ iv = mcrypt_create_iv ( mcrypt_enc_get_iv_size ( $ td ) , mcrypt_RAND ) ; mcrypt_generic_init ( $ td , $ this -> key , $ iv ) ; $ encrypted = mcrypt_generic ( $ td , $ string ) ; mcrypt_generic_deinit ( $ td ) ; return $ iv . $ encrypted ; }
Encrypts a string
@param $string The string of data to encrypt
Encrypts a string