Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is what I’m starting with, but so far I’m not sure it is working 100%:

    require_once('/var/www/po/wp-load.php');
     if(!class_exists('GDS_Encryption_Class')) die('NO ENCRYPTION CLASS');
     global $wpdb;
     $forms = $wpdb->get_results( 'SELECT id FROM '.$wpdb->prefix.'rg_lead WHERE form_id = 4', OBJECT );
     foreach ($forms as $f) {
            $results = $wpdb->get_results( 'SELECT * FROM '.$wpdb->prefix.'rg_lead_detail WHERE form_id = 4 AND lead_id = '.$f->id .'', OBJECT );
            foreach ($results as $r) {
                echo 'Encrypting '.$r->id.':'.$r->value."<hr />";
                $eData=GDS_Encryption_Class::encrypt($r->value);
                $wpdb->update($wpdb->prefix.'rg_lead_detail',array('value'=>$eData),array('id'=>$r->id));
            }
        }

    I had the same issue. Turns out it was a private key that needed to be wrapped in the:

    —–BEGIN PRIVATE KEY—–

    and

    —–END PRIVATE KEY—–

    lines.

    When we looked at the php error log, openssl_open complained about not being able to coerce parameter 4 into a private key.

Viewing 2 replies - 1 through 2 (of 2 total)