Currently only md5, password, sha1, and encrypt are supported.
At your suggestion I have added aes_encrypt to my dev version to be in the next major release.
It is easy to add. In the Dataface/Serializer.php file, you'll find a section:
- Code: Select all
if ( isset($field['encryption']) ){
$app =& Dataface_Application::getInstance();
switch(strtolower($field['encryption'])){
case 'md5':
return 'MD5('.$value.')';
case 'password':
return 'PASSWORD('.$value.')';
case 'sha1':
return 'SHA1('.$value.')';
case 'encrypt':
return 'ENCRYPT('.$value.')';
}
}
Just add another case for aes_entrypt as follows:
- Code: Select all
if ( isset($field['encryption']) ){
$app =& Dataface_Application::getInstance();
switch(strtolower($field['encryption'])){
case 'md5':
return 'MD5('.$value.')';
case 'password':
return 'PASSWORD('.$value.')';
case 'sha1':
return 'SHA1('.$value.')';
case 'encrypt':
return 'ENCRYPT('.$value.')';
case 'aes_encrypt':
return 'aes_encrypt('.$value.',\''.addslashes($app->_conf['_auth']['aes_password']).'\')';
}
}
Note then you would have in your fields.ini file:
- Code: Select all
[password]
encryption=aes_encrypt
And you would need to specify a password in your conf.ini file:
- Code: Select all
[_auth]
aes_password="My Secret Code"
-Steve