Article View: alt.privacy.anon-server
Article #239547Re: unix encryption mcrypt_encrypt mcrypt_decrypt
From: 0
Date: Fri, 02 Jul 2010 09:51
Date: Fri, 02 Jul 2010 09:51
87 lines
2154 bytes
2154 bytes
x-no-archive: yes
I got an answer if anybody wants it, read and write to a file. Here's the
script to encrypt. Write a similar one for decription.
<?php
$password = "1";
$initialization_vector = 1234567890123456;
$plain_text = file_get_contents ('colors.txt');
$encrypted_text = mcrypt_encrypt(MCRYPT_twofish, $password, $plain_text,
MCRYPT_MODE_cbc, $initialization_vector );
function ob_file_callback($buffer)
{
global $ob_file;
fwrite($ob_file,$buffer);
}
$ob_file = fopen('encrypted_text_file.txt','w');
ob_start('ob_file_callback');
//Anything we output now will go to encrypted_text_file.txt
echo $encrypted_text;
ob_end_flush();
?>
"0" <p> wrote in message news:4c2991c7$0$4980$607ed4bc@cv.net...
> x-no-archive: yes
>
> mcrypt_decrypt mcrypt_encrypt
>
> I can't encrypt / decrypt some characters like $...
>
> Parse error: syntax error, unexpected $end in /home/web/eee/encryption.php
> on line 28
>
>
> thanks
>
> <?php
>
> $plain_text = "{}[]:";'<>?,./`1234567890-=~!@#$%^&*()_+";
>
> $password = "this is the password";
>
> $initialization_vector = 11223344;
>
> $encrypted_text = mcrypt_encrypt(MCRYPT_3des, $password, $plain_text,
> MCRYPT_MODE_cfb, $initialization_vector );
>
> echo $encrypted_text ;
>
> ?>
>
>
>
>
Technical Details
Message-ID:
<4c2da88d$0$32258$607ed4bc@cv.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-sci.crypt.(901875).mbox.7z!not-for-mailReferences:
<4c2991c7$0$4980$607ed4bc@cv.net>Show Full Headers
Complete Article Headers
Message-ID: <4c2da88d$0$32258$607ed4bc@cv.net> Subject: Re: unix encryption mcrypt_encrypt mcrypt_decrypt Date: Fri, 2 Jul 2010 04:51:40 -0500 From: "0" <p> References: <4c2991c7$0$4980$607ed4bc@cv.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-sci.crypt.(901875).mbox.7z!not-for-mail Newsgroups: sci.crypt,alt.privacy.anon-server X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Lines: 85 Organization: Optimum Online NNTP-Posting-Host: 69.118.239.99 X-Complaints-To: abuse@cv.net