欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

发短信?打电话?都会被老婆查?

程序员文章站 2024-02-10 22:29:04
...

发短信?打电话?都会被老婆查。再来一利器对Ta说的的悄悄话存到图片中去吧! 完整demo包:http://www.codepearl.com/files/181.html PHP 源码与演示: 源码出处演示出处 ?php//from:http://www.codepearl.cominclude 'Simple.Stegonography.class.php';$a =

发短信?打电话?都会被老婆查。 再来一利器 对Ta说的的悄悄话存到图片中去吧!

完整demo包:http://www.codepearl.com/files/181.html PHP

源码与演示:源码出处 演示出处

发短信?打电话?都会被老婆查?
 stegoIt('hello','logo.png',1000));


//根据上一步生成的图片获取里面的内容。记得先注释掉上一步哦
echo $a -> unStegoIt('example.php.png',1000)

?>
mimeType($i);
		
		switch($mime[2]){
			case 'jpg':
				return imagecreatefromjpeg ($i);
			case 'png':
				return imagecreatefrompng ($i);
			
		}
			
    }
	
	
	/*..........*/
	//@param $text text
	//returns array of ASCII values of text
	/*.........*/
	private function toASCII($text)
	{
		$text = str_split($text);
		
		for($i=0;$icreateImage($i);
		
		$mime			=	$this->mimeType($i);
		
		$pixelCount		= $mime[0]*$mime[1];
		
		/*THIS IS THE POINT WHERE YOU CAN CHANGE THE TEXT*/
		//encrypt it maybe?  The text is in $text
		/**/
		
		$ASCII			= $this->toASCII('5TEG0'.$text.'5TEG0');
		
		$textCounter	= 0;
		
		
		
		//Is there enough space for this text?
		if($pixelCount/$steps  strlen ('5TEG0'.$text.'5TEG0'))return $im;
				}
				
			}
			
		}
			
		
		
		return $im;
		
	}
	
	/*..........*/
	//@param $i image file
	//@param $steps which pixels should be coded
	//returns image resource or false if there is not enough space in the image to do it
	/*.........*/
	public function unStegoIt($i,$steps)
	{
		$im				=	$this->createImage($i);
		
		$mime			=	$this->mimeType($i);
		
		$pixelCount		= $mime[0]*$mime[1];
		
		$textCounter	= 0;
		
		$ASCII			= array();
		

		
		
		for($x = 1;$x> 16) & 0xFF;
					$ASCII[] = ($rgb >> 8) & 0xFF;
					$ASCII[] = $rgb & 0xFF;
					
				}
				
			}
			
		}
		preg_match('#5TEG0(.+?)5TEG0#',$this->fromASCII($ASCII),$txt);
		
		/*THIS IS THE POINT WHERE YOU CAN CHANGE THE TEXT*/
		//decrypt it maybe? The text is in $txt[1]
		/**/
		
		return $txt[1];
	}
}