## how to send prime and generator of diffie hell-men to client over network node js?

I am using crypto module of node js for exchanging key using diffie-hellman algorithm.

server.js

const crypto = require("crypto");  const alice = crypto.createDiffieHellman(512);  const aliceKey = alice.generateKeys(); 

client.js

const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator());  const bobKey = bob.generateKeys();  const aliceSecret = alice.computeSecret(bobKey);  const bobSecret = bob.computeSecret(aliceKey); 

The above example is taken from node.js documentation as shown the client uses servers prime number for generating the prime number.

my question is how should I securely send the prime number and the other parameter to client over internet? are there any other alternatives?

and another question is that I am generating keys using generate keys function but I have already generated private-key.pem and public-cert.pem file. can I use those if yes then how?, if no then what is difference between those keys?

## How to install node modules for external evaluation?

I was hoping for some extra clarity configuring additional modules for use in external evaluation, since there’s no mention of this in the the nodejs workflow.

It seems mathematica looks only at ~/.node_modules, so is it sufficient to simply generate a soft link?

cd ~; ln -s node_modules .node_modules 

In decreasing importance, here are some specific sub-questions:

1. I prefer using yarn to manage required installations, do I have to use npm?
2. Do npm installs need to be global or user?
3. Does the fe or kernel need to be restarted; or evaluators re-registered after install or removal?

Knowing that any specific functionalities or modules will definitely not work (e.g. no browser …) would help, and any pro-tips from Javascript developers would be appreciated. For example, would it be possible to add a 'package.json' file for a notebook and isolate dependencies? I really don’t want these mma configuration steps to interfere with my existing node-js work.

## Insert a node in a binary search tree

The teacher gave us this code that inserts a node in a binary search tree, but I am not sure what the $$z.p = y$$ instruction does. wouldn’t the algorithm work without it?

abr_insert(T, z) //z is the node that must be inserted     {             y = NULL;             x = T.root;             while(x != NULL)             {                     y  = x;                     if(z.key < x.key)                             x = x.left;                     else                             x = x.right;             }             z.p = y; //here is the instruction that I don't understand             if(y = NULL)                 T.root = z;             else if(z.key < y,key)                     y.left = z;             else                     y.right = z;     } 

## How do we find the predecessor and the successor of a node in a B-Tree?

How can we find the predecessor and the successor of a node in a B-Tree? I mention that the search, delete and insert function are like in the article on geeksforgeeks. How can we use the getPred and getSucc functions from this article : https://www.geeksforgeeks.org/delete-operation-in-b-tree/ ? BTree t(3); // we create a B tree that has degree 3 t.Insert(6); t.Insert(5); t.Insert(4); t.Insert(3); t.Insert(2); t.Insert(1); t.Insert(0); t.Insert(-1); t.Insert(-2); Lets say we insert these keys into the B-Tree. I tried like that : treeNode* x = t.Search(3); // find the node that contains the key 3 // x->findKey(3) returns the position in the node where the key 3 appears cout << x->getPredecessor(x->findKey(3)); // that doesn’t work – How can I solve this problem? Thank you very much!

## Observation regarding finding predecessor(or successor) of a node in a Binary Search Tree(BST)

I have some propositions regarding BSTs , please can someone confirm whether they are true or false:

Situation :

1.Suppose we have a node $$n_1$$ with a value $$val_1$$ i.e $$n_1(val_1)$$

2.We wish to find the predecessor node of $$n_1$$ , with respect to inline traversal (That is the node $$n_2(val_2)$$ with $$val_2$$ being the greatest number $$val_2 < val_1$$)

3.Assume for simplicity that the BST dosen’t have any repetition

Proposition 1: Let $$n_1$$ have two children .Then $$n_2$$ has atmost one child i.e the number of children of $$n_2$$ can’t be two

Proposition 2: Let $$n_1$$ have only one child and $$n_1$$ is not root ,then also $$n_2$$ has atmost one child.

Please ascertain whether these propositions are true , but if false can someone provide a counter example ?

## Value of the Included Column is stored in Leaf Node?

There is SQL- script, which generated the Nonclustered Index with Included Column:

CREATE TABLE users    (       id        INT,       firstname VARCHAR(50),       surname   VARCHAR(50)    );   CREATE CLUSTERED INDEX ix_users_id    ON users (id);   CREATE NONCLUSTERED INDEX ix_users_firstname    ON users (firstname)    include (surname);   SELECT firstname,         surname  FROM   users  WHERE  firstname = 'John'; 

If I correctly understood, most of the time, Engine of my SQL Server 2019 will seek Nonclustered Index for the above SELECT query, without touching the Clustered Index. Does that mean the value of surname column is stored in Leaf Node of the Nonclustered Index? Also, that means the value of surname` is duplicated because it also stored in Clustered Index.

Am I right?

## do struct node *s1 in the main function allocate 4 byte of memory space? [closed]

Struct node { int data; Struct node *next; };

void main() { struct node *s1;/*does this declaration allocate 4 bytes of memory space for pointer s1? */ }

## Does all of MFA need to be on a single authentication node?

All the Multi Factor Authentication (MFA) mechanisms I have seen were installed on the same “authentication node”. What I mean by that is that a single service (say, an authentication web page, or a VPN access) were doing all the MFA checks in one place (to take the same examples: the web page is going through a login-password-OTP cycle, the VPN is checking the login, password and a certificate).

Ultimately the goal of the MFA system is to ensure that, to access a given service, more than one authentication mechanism is required.

Are there fundamental reasons for these checks not to be split between authentication nodes?

Take for instance an email system which is guaranteed to be reachable only from a given network. In order to access this network, a device must present an individual, user-issued certificate (to a NAC for instance). Or another similar combination of 2+ factors, on different systems tightly bound togather.
Is it acceptable in that case to say the “email access is protected by a MFA”?

If this is not the case, is it a problem:

• with the naming naming (“because the books/standards say that MFA is all on one system”) → that would be annoying and possibly a formal issue, but not a security risk
• of technical nature (as in “this is not secure because …”) → that would be the real showstopper

## Maximizing a nonnegative linear function over adjacency matrices with node degree constraints

Suppose $$A$$ is an $$n$$-by-$$n$$ symmetric matrix whose entries are all nonnegative. $$A_{ii} = 0$$ for all $$i$$. We want to find an $$n$$-by-$$n$$ binary ($$0/1$$ valued) matrix $$X$$ that maximizes

$$\sum_{ij} A_{ij} X_{ij}$$

under the constraints that

1. $$X$$ is symmetric ($$X^\top = X$$);
2. Each row of $$X$$ can have at most $$k$$ ones (the rest being zero);
3. The total number of $$1$$ in $$X$$ is at most $$m$$.

Here $$k \le n$$ and $$m \le n^2$$. I can think of a dynamic programming solution if 2 and 3 are the only conditions. But the symmetry in condition 1 makes it much harder. Does there exist a polynomial algorithm which can achieve multiplicatively constant approximation bound (under conditions 1, 2, 3)? Ideally the constant is universal, not dependent on $$n$$, $$k$$, or $$m$$.

If not, is there any hope for the combination of conditions 1 and 2? The combination of 1 and 3 is trivial to handle.

Thank you.

## Node ordering at contraction hierarchy of biDirectional Dijkstra

I try to understand the node ordering at contraction hierarchy.

To me, ordering and contracting node looks impossible because when contracting a node, then it influence the other node. Therefore, it looks impossible to calculate the exact node order.

Let me explain the node ordering.

According to the some parameters such as edge difference, we can order the node and put the node at the prioriry queue.

After ordering, we extract the minimum priority node.

Before contracting the node, we should compare its priority with the recomputed priority of the head of the node in the priority queue, assuming the node is contracted.

It is because the contracting behavior influence the order of the nodes.

In this case, I have a question. Is it possible we cannot extract any node in the priority queue?

For example, in the queue, there are the nodes A, B, C, D, E in the order.

When we extract the node A, we found node B is actual minimum node.

Therefore, we put node A in the queue, again and extract B.

But after that, we recomputed the priority node A, we get to know A is the minimum.

Then we have to put node B.

I think it can go on and on. Therefore we cannot contract any node.

Is my think reasonable? And then how can we design the algorithm of node ordering?