From: 0 on
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 ;

?>




From: Johan van Selst on
Once upon a newsgroup, 0 claimed:
> Parse error: syntax error, unexpected $end in /home/web/eee/encryption.php
> on line 28

> $plain_text = "{}[]:";'<>?,./`1234567890-=~!@#$%^&*()_+";

I don't know much about PHP, but I'd say the second " in this line
is misplaced. It should probably be escaped as \"


Johan
From: starwars on
> x-no-archive: yes

Above line belongs in the headers not in the message text.

From: Stray Cat on
On Tue, 29 Jun 2010 15:22:27 +0200 (CEST), starwars
<nonscrivetemi(a)tatooine.homelinux.net> wrote:

>> x-no-archive: yes
>
>Above line belongs in the headers not in the message text.


See the Google Groups Help:

http://groups.google.com/support/bin/answer.py?hl=en&answer=46487

From: Gordon Burditt on
>I can't encrypt / decrypt some characters like $...
>
>Parse error: syntax error, unexpected $end in /home/web/eee/encryption.php
>on line 28

In PHP, you probably want to use single-quoted string literals to
avoid variable substitution.
$plain_text = "$xyz";
will probably not evaluate to a string with 4 characters in it
unless $xyz has the right value.

Also, you need to escape special characters (like single quote)
inside such a literal that are supposed to be taken literally.

This seems to be a problem in your program even if you take out the
calls to do encryption entirely.

><?php
>
>$plain_text = "{}[]:";'<>?,./`1234567890-=~!@#$%^&*()_+";
^needs escaping
>
>$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 ;
>
>?>