temat ciagle powielany na forum, ale ciagle nie moge znalezc tego, czego szukam... chodzi o zwyczajne szyfrowanie z kluczem... po przecyztaniu dziesiatek artykulow o wszystkim tylko nie o tym czego szukam, musialem zalozyc nowy watek

pozdrawiam,
k.
<?php class xorCrypt { private $password = NULL; public function set_key($password) { $this->password = $password; } private function get_rnd_iv($iv_len) { $iv = ''; while ($iv_len-- > 0) { } return $iv; } public function encrypt($plain_text, $iv_len = 16) { $plain_text .= "\x13"; if ($n % 16) { $i = 0; $enc_text = $this->get_rnd_iv($iv_len); while ($i < $n) { $enc_text .= $block; $i += 16; } } else {} } public function decrypt($enc_text, $iv_len = 16) { $i = $iv_len; $plain_text = ''; while ($i < $n) { $i += 16; } } } $xorCrypt = new xorCrypt(); $xorCrypt->set_key("Your Secret Key"); $text = "hello world!"; $encrypted = $xorCrypt->encrypt($text); ?>
function x_Encrypt($string, $key) { for($i=0; $i<strlen($string); $i++) { for($j=0; $j<strlen($key); $j++) { $string[$i] = $string[$i]^$key[$j]; } } return $string; } function x_Decrypt($string, $key) { for($i=0; $i<strlen($string); $i++) { for($j=0; $j<strlen($key); $j++) { $string[$i] = $key[$j]^$string[$i]; } } return $string; }