Hi,
Here is an example (encrypt & decrypt) source-code from me.
I am using an additional codec_file to make it more secure, which contains a 128-Bit Key.
URL file-access must be enabled in the server configuration file (PHP.INI) to make the external codec file usable.
function getCodec()
{
$filename = "http://localhost/k.dec";
$filehandle = fopen($filename, "r");
$content = fread($filehandle, filesize($filename));
fclose($filehandle);
return $content;
}
function decryptor($_data)
{
return trim(mcrypt_decrypt(MCRYPT_3DES, base64_decode(getCodec()), base64_decode($_data), MCRYPT_MODE_CBC, base64_decode("fHikHLFKEdXi=")),"\x00..\x1F");
}
function encryptor($_data)
{
return (base64_encode(trim(mcrypt_encrypt(MCRYPT_3DES, base64_decode(getCodec()),$_data, MCRYPT_MODE_CBC, base64_decode("fHikHLFKEdXi=")))));
}
Vural Acar
----
Server IP: 212.124.37.9
Probable Submitter: 77.182.122.59
----
Manual Page -- http://www.php.net/manual/en/function.base64-encode.php
Edit -- https://master.php.net/note/edit/102289
Del: integrated -- https://master.php.net/note/delete/102289/integrated
Del: useless -- https://master.php.net/note/delete/102289/useless
Del: bad code -- https://master.php.net/note/delete/102289/bad+code
Del: spam -- https://master.php.net/note/delete/102289/spam
Del: non-english -- https://master.php.net/note/delete/102289/non-english
Del: in docs -- https://master.php.net/note/delete/102289/in+docs
Del: other reasons-- https://master.php.net/note/delete/102289
Reject -- https://master.php.net/note/reject/102289
Search -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.