Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-16 Thread Willem
Eventually i changed it to a varbinary(65000) column and it started to 
work. In Cakephp 2 it worked with a varchar column. now it needs to be 
binary in 3 and have enough space.

On Wednesday, March 16, 2016 at 10:19:38 AM UTC+1, heavyKevy wrote:
>
> I hate to state the obvious, but did you verify that the field size was 
> large enough to store the encrypted value?
> I had a similar issue with hashing a password, the field wasn't large 
> enough and the value was saved but cut off so that the password never 
> matched.
> Maybe try it with the max varchar size and see if it will work.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-16 Thread heavyKevy
I hate to state the obvious, but did you verify that the field size was 
large enough to store the encrypted value?
I had a similar issue with hashing a password, the field wasn't large 
enough and the value was saved but cut off so that the password never 
matched.
Maybe try it with the max varchar size and see if it will work.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-16 Thread Willem Schwarte
I have already tried to change it to text. This had the same effect. I also 
cleared the caches/orm cAche when intested this. 



> Op 16 mrt. 2016 om 00:12 heeft Christian Quispe  
> het volgende geschreven:
> 
> Cambia tu field de tu base de datos a text, es posible que tu cadena 
> codificada no se guarde completamente.
> 
> 
> 
> Enviado con MailTrack
> 
> 
> Saludos
> 
> Christian Quispe
> 
> Geek and Developer
> Miembro:  GDG Lima (Google Developer Group Lima)
> 
> Portafolio: www.oxicode.io
> 
> ¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores 
> constantemente...
> 
> 
> 2016-03-15 13:46 GMT-05:00 Willem :
>> saving to the database cuts off the encrypted data. varchar(255) and text 
>> fields both have this issue.. 
>> is this a bug in CakePHP
>> -- 
>> Sign up for our Newsletter for updates.
>> http://cakephp.org/newsletter/signup
>>  
>> We will soon be closing this Google Group. But don't worry, we have 
>> something better coming. Stay tuned for an updated from the CakePHP Team 
>> soon.
>>  
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Follow us on Twitter http://twitter.com/CakePHP
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup
>  
> We will soon be closing this Google Group. But don't worry, we have something 
> better coming. Stay tuned for an updated from the CakePHP Team soon.
>  
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Follow us on Twitter http://twitter.com/CakePHP
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-15 Thread Christian Quispe
Cambia tu field de tu base de datos a text, es posible que tu cadena
codificada no se guarde completamente.



Enviado con MailTrack


Saludos

Christian Quispe

*Geek and Developer*
*Miembro: * *GDG Lima (Google Developer Group Lima)*

*Portafolio: www.oxicode.io
*

*¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores
constantemente...*


2016-03-15 13:46 GMT-05:00 Willem :

> *saving to the database cuts off the encrypted data. varchar(255) and text
> fields both have this issue.. *
> *is this a bug in CakePHP*
>
> --
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup
>
> We will soon be closing this Google Group. But don't worry, we have
> something better coming. Stay tuned for an updated from the CakePHP Team
> soon.
>
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Follow us on Twitter http://twitter.com/CakePHP
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-15 Thread Willem
*saving to the database cuts off the encrypted data. varchar(255) and text 
fields both have this issue.. *
*is this a bug in CakePHP*

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Storing encrypted value using getter/setter not working. Stored in plain text.

2016-03-15 Thread Willem
When I try as follows, the value gets stored encryted, but I cannot read it 
as the getDecryptedUsername function returns false at the decrypt line:

protected function _setUsername($username)
{
 $key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
 if(strlen($username) > 0)
 {
 $username = Security::encrypt($username, $key);
 }
 return($username);
}

protected function _getDecryptedUsername()
{
 $key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
 $username = $this->_properties['username'];
 if(strlen($username) > 0)
 {
 $username = Security::decrypt($username, $key);
 }
 return($username);
}

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.