function decrypt($enc_string,$base64_decode=true){
		if(is_null($enc_string) || empty($enc_string)) return NULL;
		if(!$this->verified) $this->verify();
		//decrypt and return
		if($base64_decode) $enc_string = base64_decode($enc_string);
		$plain_string = mcrypt_decrypt(
			 self::$crypt_cipher
			,base64_decode($this->key)
			,$enc_string
			,self::$crypt_mode
			,base64_decode($this->iv)
		);
		//get size of string from atom
		$size = unpack('N',substr($plain_string,0,4));
		$size = array_shift($size);
		//make sure we have the original string
		$plain_string = substr($plain_string,4,$size);
		return $plain_string;
	}
function decrypt($enc_string,$base64_decode=true){
		if(is_null($enc_string) || empty($enc_string)) return NULL;
		if(!$this->verified) $this->verify();
		//decrypt and return
		if($base64_decode) $enc_string = base64_decode($enc_string);
		$plain_string = mcrypt_decrypt(
			 self::$crypt_cipher
			,base64_decode($this->key)
			,$enc_string
			,self::$crypt_mode
			,base64_decode($this->iv)
		);
		//get size of string from atom
		$size = unpack('N',substr($plain_string,0,4));
		$size = array_shift($size);
		//make sure we have the original string
		$plain_string = substr($plain_string,4,$size);
		return $plain_string;
	}
function decrypt ( $ enc_string , $ base64_decode = true ) { if ( is_null ( $ enc_string ) || empty ( $ enc_string ) ) return NULL ; if ( ! $ this -> verified ) $ this -> verify ( ) ; //decrypt and return if ( $ base64_decode ) $ enc_string = base64_decode ( $ enc_string ) ; $ plain_string = mcrypt_decrypt ( self :: $ crypt_cipher , base64_decode ( $ this -> key ) , $ enc_string , self :: $ crypt_mode , base64_decode ( $ this -> iv ) ) ; //get size of string from atom $ size = unpack ( 'N' , substr ( $ plain_string , 0 , 4 ) ) ; $ size = array_shift ( $ size ) ; //make sure we have the original string $ plain_string = substr ( $ plain_string , 4 , $ size ) ; return $ plain_string ; }
decrypt string from an optionally base64_encoded source
decrypt string from an optionally base64_encoded source