key = $key; if( $iv == 0 ) { $this->iv = $key; } else { $this->iv = $iv; } } function encrypt($str) { return base64_encode(openssl_encrypt($str, 'DES-CBC', $this->key, OPENSSL_RAW_DATA, $this->iv )); } } ?>