- $r = q("INSERT INTO `user` ( `username`, `password`, `email`, `nickname`,
- `pubkey`, `prvkey`, `verified`, `blocked` )
- VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
+ /**
+ *
+ * Create another keypair for signing/verifying
+ * salmon protocol messages. We have to use a slightly
+ * less robust key because this won't be using openssl
+ * but the phpseclib. Since it is PHP interpreted code
+ * it is not nearly as efficient, and the larger keys
+ * will take several minutes each to process.
+ *
+ */
+
+ $sres=openssl_pkey_new(array(
+ 'digest_alg' => 'sha1',
+ 'private_key_bits' => 512,
+ 'encrypt_key' => false ));
+
+ // Get private key
+
+ $sprvkey = '';
+
+ openssl_pkey_export($sres, $sprvkey);
+
+ // Get public key
+
+ $spkey = openssl_pkey_get_details($sres);
+ $spubkey = $spkey["key"];
+
+ $r = q("INSERT INTO `user` ( `username`, `password`, `email`, `openid`, `nickname`,
+ `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked` )
+ VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",