Diffie-Hellman Application Alice and Bob want to perform a Diffie-Hellman key exchange using the group $G$, a
primitive root $g$, Alice’s secret key $k_A$ and Bob’s secret key $k_B$. In each case below
compute the element of $G$ that Alice sends to Bob, the element that Bob sends to
Alice, and the secret key that Alice and Bob will share.


$G=\mathbb Z/163\mathbb Z$(as an additive group), $g = 2$, $k_A = 128$, $k_B = 65$.
$G=\mathbb F_{163}^*$, $g = 2$, $k_A = 128$, $k_B = 65$
$G = [0, 1) ∩ \mathbb Q$ with group operation
$$a\Diamond b = [a + b] = a + b − \left \lceil{a+b}\right \rceil$$
$g = 23/123$, $k_A = 358$ and $k_B = −44$.
$G = GL_2(\mathbb F_{17})$, $g= \left[\begin{array}{ c c }
     2 &amp; 3 \\
     4 &amp; 5
  \end{array} \right]$, $k_A = 13$, $k_B = 5$.


For $1)$  I did the following, Alice sends Bob $A = (128)2 \bmod p$ and then Bob sends Alice $B = (65)2 \bmod p$. Their secret key is $(128+65)2 \bmod p$.

For $2)$ I did this: Alice sends Bob $A = 2^{128}$ $mod p$ and Bob sends Alice $B = 2^{65} \bmod p$ Therefore, their secret key is $B = 2^{(65)(128)} \bmod p$.

For $3)$ Alice sends Bob $128\Diamond 23/123$ and Bob sends Alice $65\Diamond 23/123$ so their secret key is $(128\Diamond 65)\Diamond 23/123$. However I don't know whether this is right or not.

I don't know how to do the fourth one.

Any help is appreciated. Thank you.
Eve shouldn't be able to find the shared secret easily from the messages Alice and Bob send.

In the questions 1 and 2, you said that the shared secret is the sum/the product of the two messages, but anyone can compute them. Therefore, you are wrong.
The shared secret should be: 
1) $B=(128)(65)2 = (65)(128)2\mod p$, 
2) $B=(2^{(65)})^{(128)}=(2^{(128)})^{(65)}\mod p$.

Once you understood these two examples, I am sure you will be able to solve the 2 other questions easily by thinking a bit more about it.

Edit: you're right about 2).