From: 0 on 29 Jun 2010 03:25 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 29 Jun 2010 03:22 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 29 Jun 2010 09:22 > x-no-archive: yes Above line belongs in the headers not in the message text.
From: Stray Cat on 29 Jun 2010 10:18 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 29 Jun 2010 14:24 >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 ; > >?>
|
Next
|
Last
Pages: 1 2 Prev: Popular Cryptography Magazine Next: Cryptanalyis by Cloning Data from Regular Data. |