Hi,
I'm trying to encrypt ALL the password
fields before saving them in DB using something like this:
function my_encrypt_function ( $new ) {
$secret_key = 'XXXXXXXXXXX';
$secret_vector = 'YYYYYYYYYYY';
$key = hash( 'sha256', $secret_key );
$vector = substr( hash( 'sha256', $secret_vector ), 0, 16 );
return base64_encode( openssl_encrypt( $new, 'AES-256-CBC', $key, 0, $vector ) );
};
add_filter( 'rwmb_password_value', 'my_encrypt_function' );
But this is not working when the password
field is a sub-field inside a group
field:
$meta_boxes[] = [
'title' => 'My fields',
'id' => 'my_fields',
'fields' => [
[
'id' => 'my_group',
'type' => 'group',
'fields' => [
[
'name' => 'My Password',
'id' => 'my_password',
'type' => 'password',
],
],
],
]
];
Is there any other filter or way to do the same?