begin process at 2012 02 09 10:45:24
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Maths & Algorithmes

 > ALGORITHME DE CRYPTAGE SIMPLE

ALGORITHME DE CRYPTAGE SIMPLE


 Information sur la source

Note :
7,4 / 10 - par 5 personnes
7,40 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Maths & Algorithmes Niveau :Initié Date de création :17/06/2004 Date de mise à jour :17/06/2004 16:48:38 Vu :14 299

Auteur : Isoth0p

Ecrire un message privé
Site perso
Commentaire sur cette source (18)
Ajouter un commentaire et/ou une note

 Description

Une classe de cryptage basique ...
L'abondence des boucles rend celui-ci assez lent et doit pouvoir etre facilement optimisable.

Source

  • <?
  • class Cypher_dKe
  • {
  • var $data = array();
  • var $K = array(
  • 0x493e0, 0x61a80, 0x7a120, 0x927c0, 0xaae60,
  • 0xc3500, 0xdbba0, 0xf4240, 0x10c8e0, 0x124f80,
  • 0x13d620, 0x155cc0, 0x16e360, 0x186a00, 0x19f0a0,
  • 0x1b7740, 0x1cfde0, 0x1e8480, 0x200b20, 0x2191c0,
  • 0x231860, 0x249f00, 0x2625a0, 0x27ac40, 0x2932e0,
  • 0x2ab980, 0x2c4020, 0x2dc6c0, 0x2f4d60, 0x30d400,
  • 0x325aa0, 0x33e140, 0x3567e0, 0x36ee80, 0x387520,
  • 0x39fbc0, 0x3b8260, 0x3d0900, 0x3e8fa0, 0x401640,
  • 0x419ce0, 0x432380, 0x44aa20, 0x4630c0, 0x47b760,
  • 0x493e00, 0x4ac4a0, 0x4c4b40, 0x4dd1e0, 0x4f5880,
  • 0x50df20, 0x5265c0, 0x53ec60, 0x557300, 0x56f9a0,
  • 0x588040, 0x5a06e0, 0x5b8d80, 0x5d1420, 0x5e9ac0,
  • 0x602160, 0x61a800, 0x632ea0, 0x64b540, 0x663be0,
  • 0x67c280, 0x694920, 0x6acfc0, 0x6c5660, 0x6ddd00,
  • 0x6f63a0, 0x70ea40, 0x7270e0, 0x73f780, 0x757e20,
  • 0x7704c0, 0x788b60, 0x7a1200, 0x7b98a0, 0x7d1f40,
  • 0x7ea5e0, 0x802c80, 0x81b320, 0x8339c0, 0x84c060,
  • 0x864700, 0x87cda0, 0x895440, 0x8adae0, 0x8c6180,
  • 0x8de820, 0x8f6ec0, 0x90f560, 0x927c00, 0x9402a0,
  • 0x958940, 0x970fe0, 0x989680, 0x9a1d20, 0x9ba3c0,
  • 0x9d2a60, 0x9eb100, 0xa037a0, 0xa1be40, 0xa344e0,
  • 0xa4cb80, 0xa65220, 0xa7d8c0, 0xa95f60, 0xaae600,
  • 0xac6ca0, 0xadf340, 0xaf79e0, 0xb10080, 0xb28720,
  • 0xb40dc0, 0xb59460, 0xb71b00, 0xb8a1a0, 0xba2840,
  • 0xbbaee0, 0xbd3580, 0xbebc20, 0xc042c0, 0xc1c960,
  • 0xc35000, 0xc4d6a0, 0xc65d40, 0xc7e3e0, 0xc96a80,
  • 0xcaf120, 0xcc77c0, 0xcdfe60, 0xcf8500, 0xd10ba0,
  • 0xd29240, 0xd418e0, 0xd59f80, 0xd72620, 0xd8acc0,
  • 0xda3360, 0xdbba00, 0xdd40a0, 0xdec740, 0xe04de0,
  • 0xe1d480, 0xe35b20, 0xe4e1c0, 0xe66860, 0xe7ef00,
  • 0xe975a0, 0xeafc40, 0xec82e0, 0xee0980, 0xef9020,
  • 0xf116c0, 0xf29d60, 0xf42400, 0xf5aaa0, 0xf73140,
  • 0xf8b7e0, 0xfa3e80, 0xfbc520, 0xfd4bc0, 0xfed260,
  • 0x1005900, 0x101dfa0, 0x1036640, 0x104ece0, 0x1067380,
  • 0x107fa20, 0x10980c0, 0x10b0760, 0x10c8e00, 0x10e14a0,
  • 0x10f9b40, 0x11121e0, 0x112a880, 0x1142f20, 0x115b5c0,
  • 0x1173c60, 0x118c300, 0x11a49a0, 0x11bd040, 0x11d56e0,
  • 0x11edd80, 0x1206420, 0x121eac0, 0x1237160, 0x124f800,
  • 0x1267ea0, 0x1280540, 0x1298be0, 0x12b1280, 0x12c9920,
  • 0x12e1fc0, 0x12fa660, 0x1312d00, 0x132b3a0, 0x1343a40,
  • 0x135c0e0, 0x1374780, 0x138ce20, 0x13a54c0, 0x13bdb60,
  • 0x13d6200, 0x13ee8a0, 0x1406f40, 0x141f5e0, 0x1437c80,
  • 0x1450320, 0x14689c0, 0x1481060, 0x1499700, 0x14b1da0,
  • 0x14ca440, 0x14e2ae0, 0x14fb180, 0x1513820, 0x152bec0,
  • 0x1544560, 0x155cc00, 0x15752a0, 0x158d940, 0x15a5fe0,
  • 0x15be680, 0x15d6d20, 0x15ef3c0, 0x1607a60, 0x1620100,
  • 0x16387a0, 0x1650e40, 0x16694e0, 0x1681b80, 0x169a220,
  • 0x16b28c0, 0x16caf60, 0x16e3600, 0x16fbca0, 0x1714340,
  • 0x172c9e0, 0x1745080, 0x175d720, 0x1775dc0, 0x178e460,
  • 0x17a6b00, 0x17bf1a0, 0x17d7840, 0x17efee0, 0x1808580,
  • 0x1820c20, 0x18392c0, 0x1851960, 0x186a000, 0x18826a0,
  • 0x189ad40, 0x18b33e0, 0x18cba80, 0x18e4120, 0x18fc7c0,
  • 0x1914e60, 0x192d500, 0x1945ba0, 0x195e240, 0x19768e0,
  • 0x198ef80, 0x19a7620, 0x19bfcc0, 0x19d8360, 0x19f0a00,
  • 0x1a090a0, 0x1a21740, 0x1a39de0, 0x1a52480, 0x1a6ab20,
  • 0x1a831c0, 0x1a9b860, 0x1ab3f00, 0x1acc5a0, 0x1ae4c40,
  • 0x1afd2e0, 0x1b15980, 0x1b2e020, 0x1b466c0, 0x1b5ed60,
  • 0x1b77400, 0x1b8faa0, 0x1ba8140, 0x1bc07e0, 0x1bd8e80,
  • 0x1bf1520, 0x1c09bc0, 0x1c22260, 0x1c3a900, 0x1c52fa0,
  • 0x1c6b640, 0x1c83ce0, 0x1c9c380, 0x1cb4a20, 0x1ccd0c0
  • );
  • var $ret = false;
  • function dkcypher($param = false)
  • {
  • return true;
  • }
  • function encrypt($string)
  • {
  • $this->data['char'] = array();
  • $this->data['cypher'] = array();
  • $this->data['length'] = strlen($string);
  • if(($this->data['length'] % 2) == 1)
  • {
  • $string .= chr( 0x00 );
  • $this->data['length'] += 1;
  • }
  • for($i = 0; $i < $this->data['length']; $i++)
  • $this->data['char'][] = base_convert( ord( $string{$i} ), 10, 8);
  • for($i = 0; $i < $this->data['length']; $i++)
  • {
  • $L = $this->data['char'][$i];
  • $R = $this->data['char'][$this->data['length'] - $i - 1];
  • for($j = 0; $j < 300; $j++)
  • {
  • $L ^= $this->K[$j];
  • $R ^= $this->K[$j];
  • }
  • $this->data['cypher'][$i] = $L;
  • $this->data['cypher'][$this->data['length'] - $i - 1] = $R;
  • }
  • $this->ret = false;
  • for($i = 0; $i < $this->data['length']; $i++)
  • {
  • $this->ret .= ( chr( substr( $this->data['cypher'][$i], 0, 2) ) ^ '&' );
  • $this->ret .= ( chr( substr( $this->data['cypher'][$i], 2, 2) ) ^ '%' );
  • $this->ret .= ( chr( substr( $this->data['cypher'][$i], 4, 2) ) ^ '$' );
  • $this->ret .= ( chr( substr( $this->data['cypher'][$i], 6, 2) ) ^ '?' );
  • }
  • return $this->ret;
  • }
  • function decrypt($string)
  • {
  • $this->data['char'] = array();
  • $this->data['length'] = strlen($string);
  • $this->data['dlength'] = 0;
  • $this->data['decypher'] = array();
  • $this->data['decypher']['char'] = array();
  • $this->data['decypher']['string'] = false;
  • for($i = 0; $i < $this->data['length']; $i += 4)
  • {
  • $this->data['char'][] = $string{$i} ^ '&';
  • $this->data['char'][] = $string{$i+1} ^ '%';
  • $this->data['char'][] = $string{$i+2} ^ '$';
  • $this->data['char'][] = $string{$i+3} ^ '?';
  • }
  • for($i = 0; $i < $this->data['length']; $i += 4)
  • {
  • $s1 = ord( $this->data['char'][$i] );
  • $s2 = ord( $this->data['char'][$i+1] );
  • $s3 = ord( $this->data['char'][$i+2] );
  • $s4 = ord( $this->data['char'][$i+3] );
  • $s1 = ( $s1 < 10 ) ? ( '0' . $s1 ) : $s1;
  • $s2 = ( $s2 < 10 ) ? ( '0' . $s2 ) : $s2;
  • $s3 = ( $s3 < 10 ) ? ( '0' . $s3 ) : $s3;
  • $s4 = ( $s4 < 10 ) ? ( '0' . $s4 ) : $s4;
  • $this->data['decypher']['char'][] = $s1 . $s2 . $s3 . $s4 ;
  • }
  • $this->data['dlength'] = count($this->data['decypher']['char']);
  • $this->data['char'] = array();
  • for($i = 0; $i < $this->data['dlength']; $i++)
  • {
  • $L = $this->data['decypher']['char'][$i];
  • $R = $this->data['decypher']['char'][$this->data['dlength'] - $i - 1];
  • for($j = 0; $j < 300; $j++)
  • {
  • $L ^= $this->K[$j];
  • $R ^= $this->K[$j];
  • }
  • $this->data['char'][$i] = $L;
  • $this->data['char'][$this->data['dlength'] - $i - 1] = $R;
  • }
  • $this->ret = false;
  • for($i = 0; $i < $this->data['dlength']; $i++)
  • $this->ret .= chr ( base_convert( $this->data['char'][$i], 8, 10) );
  • return $this->ret;
  • }
  • }
  • $dKe = new Cypher_dKe();
  • ?>
<?

class Cypher_dKe
{
	var $data = array();
	var $K = array(
		0x493e0,	0x61a80,	0x7a120,	0x927c0,	0xaae60,	
		0xc3500,	0xdbba0,	0xf4240,	0x10c8e0,	0x124f80,	
		0x13d620,	0x155cc0,	0x16e360,	0x186a00,	0x19f0a0,	
		0x1b7740,	0x1cfde0,	0x1e8480,	0x200b20,	0x2191c0,	
		0x231860,	0x249f00,	0x2625a0,	0x27ac40,	0x2932e0,	
		0x2ab980,	0x2c4020,	0x2dc6c0,	0x2f4d60,	0x30d400,	
		0x325aa0,	0x33e140,	0x3567e0,	0x36ee80,	0x387520,	
		0x39fbc0,	0x3b8260,	0x3d0900,	0x3e8fa0,	0x401640,	
		0x419ce0,	0x432380,	0x44aa20,	0x4630c0,	0x47b760,	
		0x493e00,	0x4ac4a0,	0x4c4b40,	0x4dd1e0,	0x4f5880,	
		0x50df20,	0x5265c0,	0x53ec60,	0x557300,	0x56f9a0,	
		0x588040,	0x5a06e0,	0x5b8d80,	0x5d1420,	0x5e9ac0,	
		0x602160,	0x61a800,	0x632ea0,	0x64b540,	0x663be0,	
		0x67c280,	0x694920,	0x6acfc0,	0x6c5660,	0x6ddd00,	
		0x6f63a0,	0x70ea40,	0x7270e0,	0x73f780,	0x757e20,	
		0x7704c0,	0x788b60,	0x7a1200,	0x7b98a0,	0x7d1f40,	
		0x7ea5e0,	0x802c80,	0x81b320,	0x8339c0,	0x84c060,	
		0x864700,	0x87cda0,	0x895440,	0x8adae0,	0x8c6180,	
		0x8de820,	0x8f6ec0,	0x90f560,	0x927c00,	0x9402a0,	
		0x958940,	0x970fe0,	0x989680,	0x9a1d20,	0x9ba3c0,	
		0x9d2a60,	0x9eb100,	0xa037a0,	0xa1be40,	0xa344e0,	
		0xa4cb80,	0xa65220,	0xa7d8c0,	0xa95f60,	0xaae600,	
		0xac6ca0,	0xadf340,	0xaf79e0,	0xb10080,	0xb28720,	
		0xb40dc0,	0xb59460,	0xb71b00,	0xb8a1a0,	0xba2840,	
		0xbbaee0,	0xbd3580,	0xbebc20,	0xc042c0,	0xc1c960,	
		0xc35000,	0xc4d6a0,	0xc65d40,	0xc7e3e0,	0xc96a80,	
		0xcaf120,	0xcc77c0,	0xcdfe60,	0xcf8500,	0xd10ba0,	
		0xd29240,	0xd418e0,	0xd59f80,	0xd72620,	0xd8acc0,	
		0xda3360,	0xdbba00,	0xdd40a0,	0xdec740,	0xe04de0,	
		0xe1d480,	0xe35b20,	0xe4e1c0,	0xe66860,	0xe7ef00,	
		0xe975a0,	0xeafc40,	0xec82e0,	0xee0980,	0xef9020,	
		0xf116c0,	0xf29d60,	0xf42400,	0xf5aaa0,	0xf73140,	
		0xf8b7e0,	0xfa3e80,	0xfbc520,	0xfd4bc0,	0xfed260,	
		0x1005900,	0x101dfa0,	0x1036640,	0x104ece0,	0x1067380,	
		0x107fa20,	0x10980c0,	0x10b0760,	0x10c8e00,	0x10e14a0,	
		0x10f9b40,	0x11121e0,	0x112a880,	0x1142f20,	0x115b5c0,	
		0x1173c60,	0x118c300,	0x11a49a0,	0x11bd040,	0x11d56e0,	
		0x11edd80,	0x1206420,	0x121eac0,	0x1237160,	0x124f800,	
		0x1267ea0,	0x1280540,	0x1298be0,	0x12b1280,	0x12c9920,	
		0x12e1fc0,	0x12fa660,	0x1312d00,	0x132b3a0,	0x1343a40,	
		0x135c0e0,	0x1374780,	0x138ce20,	0x13a54c0,	0x13bdb60,	
		0x13d6200,	0x13ee8a0,	0x1406f40,	0x141f5e0,	0x1437c80,	
		0x1450320,	0x14689c0,	0x1481060,	0x1499700,	0x14b1da0,	
		0x14ca440,	0x14e2ae0,	0x14fb180,	0x1513820,	0x152bec0,	
		0x1544560,	0x155cc00,	0x15752a0,	0x158d940,	0x15a5fe0,	
		0x15be680,	0x15d6d20,	0x15ef3c0,	0x1607a60,	0x1620100,	
		0x16387a0,	0x1650e40,	0x16694e0,	0x1681b80,	0x169a220,	
		0x16b28c0,	0x16caf60,	0x16e3600,	0x16fbca0,	0x1714340,	
		0x172c9e0,	0x1745080,	0x175d720,	0x1775dc0,	0x178e460,	
		0x17a6b00,	0x17bf1a0,	0x17d7840,	0x17efee0,	0x1808580,	
		0x1820c20,	0x18392c0,	0x1851960,	0x186a000,	0x18826a0,	
		0x189ad40,	0x18b33e0,	0x18cba80,	0x18e4120,	0x18fc7c0,	
		0x1914e60,	0x192d500,	0x1945ba0,	0x195e240,	0x19768e0,	
		0x198ef80,	0x19a7620,	0x19bfcc0,	0x19d8360,	0x19f0a00,	
		0x1a090a0,	0x1a21740,	0x1a39de0,	0x1a52480,	0x1a6ab20,	
		0x1a831c0,	0x1a9b860,	0x1ab3f00,	0x1acc5a0,	0x1ae4c40,	
		0x1afd2e0,	0x1b15980,	0x1b2e020,	0x1b466c0,	0x1b5ed60,	
		0x1b77400,	0x1b8faa0,	0x1ba8140,	0x1bc07e0,	0x1bd8e80,	
		0x1bf1520,	0x1c09bc0,	0x1c22260,	0x1c3a900,	0x1c52fa0,	
		0x1c6b640,	0x1c83ce0,	0x1c9c380,	0x1cb4a20,	0x1ccd0c0	
	);
	var $ret = false;
	
	
	function dkcypher($param = false)
	{
		return true;
	}


	function encrypt($string)
	{
		$this->data['char'] = array();
		$this->data['cypher'] = array();
		$this->data['length'] = strlen($string);
		
		if(($this->data['length'] % 2) == 1)
		{
			$string .= chr( 0x00 );
			$this->data['length'] += 1;
		}
		
		for($i = 0; $i < $this->data['length']; $i++)
			$this->data['char'][] = base_convert( ord( $string{$i} ), 10, 8);

		for($i = 0; $i < $this->data['length']; $i++)
		{
			$L = $this->data['char'][$i];
			$R = $this->data['char'][$this->data['length'] - $i - 1];

			for($j = 0; $j < 300; $j++)
			{
				$L ^= $this->K[$j];
				$R ^= $this->K[$j];
			}
			
			$this->data['cypher'][$i] = $L;
			$this->data['cypher'][$this->data['length'] - $i - 1] = $R;
		}

		$this->ret = false;
		for($i = 0; $i < $this->data['length']; $i++)
		{
			$this->ret .= ( chr( substr( $this->data['cypher'][$i], 0, 2) ) ^ '&' );
			$this->ret .= ( chr( substr( $this->data['cypher'][$i], 2, 2) ) ^ '%' );
			$this->ret .= ( chr( substr( $this->data['cypher'][$i], 4, 2) ) ^ '$' );
			$this->ret .= ( chr( substr( $this->data['cypher'][$i], 6, 2) ) ^ '?' );
		}
		
		return $this->ret;
	}


	function decrypt($string)
	{
		$this->data['char'] = array();
		$this->data['length'] = strlen($string);
		$this->data['dlength'] = 0;
		
		$this->data['decypher'] = array();
		$this->data['decypher']['char'] = array();
		$this->data['decypher']['string'] = false;
		
		for($i = 0; $i < $this->data['length']; $i += 4)
		{
			$this->data['char'][] = $string{$i}   ^ '&';
			$this->data['char'][] = $string{$i+1} ^ '%';
			$this->data['char'][] = $string{$i+2} ^ '$';
			$this->data['char'][] = $string{$i+3} ^ '?';
		}
		
		for($i = 0; $i < $this->data['length']; $i += 4)
		{
			$s1 = ord( $this->data['char'][$i]   );
			$s2 = ord( $this->data['char'][$i+1] );
			$s3 = ord( $this->data['char'][$i+2] );
			$s4 = ord( $this->data['char'][$i+3] );
			
			$s1 = ( $s1 < 10 ) ? ( '0' . $s1 ) : $s1;
			$s2 = ( $s2 < 10 ) ? ( '0' . $s2 ) : $s2;
			$s3 = ( $s3 < 10 ) ? ( '0' . $s3 ) : $s3;
			$s4 = ( $s4 < 10 ) ? ( '0' . $s4 ) : $s4;			
			
			$this->data['decypher']['char'][] = $s1 . $s2 . $s3 . $s4 ;
		}
		
		$this->data['dlength'] = count($this->data['decypher']['char']);
		$this->data['char'] = array();
		
		for($i = 0; $i < $this->data['dlength']; $i++)
		{
			$L = $this->data['decypher']['char'][$i];
			$R = $this->data['decypher']['char'][$this->data['dlength'] - $i - 1];
			
			for($j = 0; $j < 300; $j++)
			{
				$L ^= $this->K[$j];
				$R ^= $this->K[$j];
			}
			
			$this->data['char'][$i] = $L;
			$this->data['char'][$this->data['dlength'] - $i - 1] = $R;
		}
		
		$this->ret = false;
		for($i = 0; $i < $this->data['dlength']; $i++)
			$this->ret .= chr ( base_convert( $this->data['char'][$i], 8, 10) );
		
		return $this->ret;
	}
}

$dKe = new Cypher_dKe();

?>

 Conclusion

Le code n'est pas commenté ... désolé pour celà


 Sources du même auteur

[PHP4] AJOUTER UN COPYRIGHT DANS UNE IMAGE - CLASS ADDCOPYR...
CHECKSUMS ET IPV4

 Sources de la même categorie

EXEMPLE D'APPLICATION DE L'ALGORITHME DE DIJKSTRA EN PHP par philtr8
CLEF POUR EAN 13 ET 14 par RaftY
FONCTION DE CALCUL DU NOMBRE DE DUEL UNIQUE POUR UN NOMBRE N... par mtrix000
Source avec Zip Source avec une capture TRIANGLE DE PASCAL ET SON ÉQUATION par vendeeHdLR89
Source avec Zip CONVERTISSEUR LAMBERT2 ÉTENDU EN COORDONNÉE GÉOGRAPHIQUE (LO... par varfendell

Commentaires et avis

Commentaire de gege217 le 18/06/2004 09:42:42

Tu dois surement savoir qu'il existe une librairie de cryptage dans PHP (MCRYPT) qui fait la même chose mais qui est plus performante (car native) et elle est plus éttofé...

http://fr.php.net/manual/fr/ref.mcrypt.php

.oOMimiLOo.

Commentaire de Isoth0p le 18/06/2004 12:23:26

gege217, oui je le sais, mais le but était de montrer comment on peut créer un petit algorithme de cryptage. la performance n'était pas recherché. c'est gentil de m'avoir noté 5/10 lorsque l'on a pas réflicht au but premier de la publication de la source ...

Commentaire de Kyoto le 18/06/2004 12:29:53

yeah ça c du php ^__^

Commentaire de kalachnikov le 21/06/2004 17:19:49

plutot qu on passe des heures a comprendre le code en rajoutant les commentaires,
y a moyen que tu nous explique ca en quelques grandes lignes ?

Commentaire de Isoth0p le 23/08/2004 22:02:46

en fait il s'agit d'un cryptage tout simple.
il recupere la valeur ASCII de chaque lettre, passe la valeur en base octale et effectue 300 XORs dessus. On obtient ensemble un nombre dont les segments 2 à 2 sont eux aussi encodés par un XOR. le résultat final est converti en caractèeres afin d'être affiché

Commentaire de coucou747 le 10/12/2004 23:24:36 administrateur CS

T'as pas de clef ???? je ne vois qu'un seul argument aux fonctions....

Sinbon la fonction native ets plus puissante puisqu'elle crypte en DES...

Si tu veux tu peux refaire le monde, masi un language compilé serait mieux pour cela car plus rapide...

Commentaire de PROTECTIONNISTE le 23/05/2005 09:53:50

Sinon la fonction native est plus puissante puisqu'elle crypte en DES...

à savoir qu'il y à d'autre cryptage que le DES avec mcrypt() autre, entre autres : 3DES(tripleDES), 3-WAY, SAFER-SK64 (et aussi en 128bits >> SAFER-SK128), RC6, etc.

Commentaire de hisoka2501 le 15/07/2005 19:35:39

il existe pas des cryptages de 4096 bits en php ? :$

Commentaire de coucou747 le 15/07/2005 20:06:12 administrateur CS

les cryptages en 4096 sont interdit par la loi française...
Ils sont aussi déconseillés à cause de leur lenteur...

On ne peut pas tout faire en 4096 non plus...

En AES, on ne fait que du 256 dans le meilleur des cas,
En DES du 56
En triple DES, généralement, du 112, mais parfois du 168...
Reste plein de DES, ou alors des assymétriques...

T'as aussi les masques (je peux te faire une source php qui crypte avec toute forme de masques...) Les masques ont une taille illimités, mais si on reste en 128, leur efficacitée est nulle...

Commentaire de hisoka2501 le 16/07/2005 00:09:17

ben en fait pour resumer ce que je cherche c une fonction qui retournerais un texte crypté par un mot de passe, car sur mon site ya des chemin que je voudrais garder caché mais tout en gardan la méthode $_GET['sub'] pour que les gens puisses tout de meme linker les pages

un truc du genre $crypt_text('texte que je veu','mdp') et avec des caracteres a peu pres normaux :$ é surtout qui soi decodable car g bien penssé au md5 mais po dechifrable donc bon :$

Commentaire de coucou747 le 16/07/2005 01:10:16 administrateur CS

alors pourquoi du 4096 ??

Commentaire de hisoka2501 le 16/07/2005 05:39:08

car je suis parano :$
c'est une de mes manies et je devrais bien m"en debarasser je le reconais, g tenté un system de cryptage la utilisan mcrypt: ca marche pas car le navigateur me remplace pas mal de caracteres dans ma variable en GET
du genre:
http://kankai.dyndns.org:1200/index.php?page=wall&sub=O%05%11%E2%80%B9%C3%8E%0BB%C3%AC%C3%92%C2%8FF)%E2%80%94#\%CB%86/

donc forcement jvais pas aller loin comme ca :$
( en meme temp je debute en php :$ )

c poru ca que je cherche un algo de cryptage/decryptage qui garde des caracteres normaux, de a-z A-Z 0-9
mais ca coure pas les rues aparement :'(

Commentaire de coucou747 le 17/07/2005 13:26:19 administrateur CS

mcrypt + base64_encode

Commentaire de hisoka2501 le 17/07/2005 19:35:55

c'est génial ca marche :D tu est génial

grace a toi jvais enfin pouvoir éssayer de finir ma gallerie (j'en suis encor au probleme du positionement des images)

Commentaire de hisoka2501 le 17/07/2005 20:33:30

ca marche mais g un soucis lors du decodage:

img/wallpapers ¤ sora.jpg

a la place de ¤ se trouve un carac que je n'arriv meme pas a selectioner mais qui me pose Beaucoup de problemes
par example il detabule un peu tout et il fait que
filetype($dir.$file) == 'dir'

donc évidement c"est un gros probleme :$

Commentaire de hisoka2501 le 17/07/2005 21:06:14

pour etre plus précis regarde:
http://kankai.dyndns.org:1200/index.php?page=wall&sub=TwURi84LQuzSj0YplyNciA==/

entre les lien c la valeur de $dir.$file

étrange non ? :$

Commentaire de coucou747 le 17/07/2005 21:45:49 administrateur CS

va sur le forum...

Commentaire de lectpe le 14/05/2009 14:14:12

Salut.

En PHP, tu as une fonction qui s'appelle crypt.

Appel : crypt("ce que tu veux crypter");

et tu obtiens un code crypté. Il n'existe pas d'algorithme de décryptage. Seul les serveurs PHP peuvent décrypter ce message.

Un même mot, expression, chiffre ou variable quelconque peut avoir plusieurs transcryptions possibles.

Cordialement, Grégory.

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,312 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales