Published in: PHP
<?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"); $xorCrypt->encrypt("unencrypted text"); $xorCrypt->decrypt("encrypted text"); ?>
You need to login to post a comment.
