Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9714

Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT)

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT)
Date 2013-05-30 08:09 -0400
Organization A noiseless patient Spider
Message-ID <ko7f8o$of4$1@dont-email.me> (permalink)
References <da27d0df-6b91-4adc-9658-dea365e1ba02@dl10g2000vbb.googlegroups.com>

Show all headers | View raw


On 5/30/2013 2:28 AM, ViVi wrote:
> This is driving me crazy !
> I'm getting a string from the user (form,input,type=text)
> I escape it (mysql_real_escape_string)
> And write it encrypted to DB (AES_ENCRYPT).
> Then I read it back (SELECT  AES_DECRYPT).
> It works 99.99 % of the time.
> "Sometime" it fails: i.e. the read value is NOT = to the written one.
> To be more specific: the "encrypted" value (select 'catName') contains
> something, the decrypted one ( SELECT  AES_DECRYPT(`catName`...)
> contains garbage.
> I've not been able to track down WHEN it fails, but some strings
> everytime fail, other strings are OK.
> OK are .... almost all
> the following string
> doppio " apice
> FAILS everytime.
> I've tried defining the DB field (catName) VARCHAR or BINARY to no
> avail.
> I dont thing it's a "quote" problem, because if I dont encrypt/decrypt
> the string all works fine.
> Can someone help me ?
> TIA
>
<snip code>


Vivi,

Since your problem seems to be with the MySQL functions, you'll probably 
get better help in comp.databases.mysql, where the MySQL experts hang out.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

problem encrypting data (AES_ENCRYPT/AES_DECRYPT) ViVi <vincenzo.viboni@gmail.com> - 2013-05-29 23:28 -0700
  Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-30 07:46 +0000
    Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) The Natural Philosopher <tnp@invalid.invalid> - 2013-05-30 09:21 +0100
      Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) ViVi <vincenzo.viboni@gmail.com> - 2013-05-30 01:58 -0700
        Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-30 10:53 +0000
          Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) ViVi <vincenzo.viboni@gmail.com> - 2013-05-30 04:53 -0700
            Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) The Natural Philosopher <tnp@invalid.invalid> - 2013-05-30 13:52 +0100
  Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) Jerry Stuckle <jstucklex@attglobal.net> - 2013-05-30 08:09 -0400
    Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) ViVi <vincenzo.viboni@gmail.com> - 2013-05-30 07:05 -0700
      Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) The Natural Philosopher <tnp@invalid.invalid> - 2013-05-30 15:34 +0100
        Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) ViVi <vincenzo.viboni@gmail.com> - 2013-05-30 07:38 -0700
          Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT) The Natural Philosopher <tnp@invalid.invalid> - 2013-05-30 15:57 +0100
          OT: MySQL AES_ENCRYPT/AES_DECRYPT (was: Re: problem encrypting data (AES_ENCRYPT/AES_DECRYPT)) Arno Welzel <usenet@arnowelzel.de> - 2013-06-05 14:51 +0200

csiph-web