## tls – Why can’t we encrypt the message with sender’s private key and receiver’s public key in case of sending messages through a server?

I read that why do we need E2EE and can’t rely only on HTTPS for sending messages through a messaging app. The reason which i understood is when sender sends the message to the server, the TLS connection is associated with the server. TLS terminates at the server and whoever controls the server has the ability to view the messages since they are not encrypted.But, In this process when we send a message to the server, we are firstly encrypting the message with sender’s private key and then with server’s public key.

My question is why can’t we encrypt the message with sender’s private key and then receiver’s public key? In this way, even if it reaches server, it won’t be able to view anything since it can only be decrypted using receiver’s private key.

## algorithms – Distribution of resources from providers to maximum number of receivers

This problem is a case of maximum flow problem.

Suppose we are given internet providers $$p_1, p_2, cdots, p_m$$ and residents $$r_1, r_2, cdots, r_n$$. Consider a flow network specified as the following.

• Nodes are $$s, p_1, p_2, cdots, p_m, r_1, r_2, cdots, r_n, t$$, where $$s$$ and $$t$$ are two extra nodes standing for the source and the sink.
• There is an edge between $$s$$ and each $$p_i$$ with capacity $$k_i$$.
• There is an edge between $$p_i$$ and $$r_j$$ with capacity 1 if $$p_i$$ can provide internet to $$r_j$$.
• There is an edge between each $$r_j$$ and $$t$$ with capacity 1.

What we want is to find the maximum flow from $$s$$ to $$t$$.

There are many algorithms to solve a maximum flow problem in polynomial time. For example, Ford–Fulkerson algorithm and Dinic’s algorithm are pretty popular. Source code that implement those algorithms in various programming languages can be found easily.

All those algorithm will produce an integral maximal flow, so we will not worry in case the computed maximal flow stipulates that some provider should provide 0.42 or $$frac{sqrt2}2$$ internet to some resident. You can check the integral flow theorem.

## script – How does the sender know the receiver’s public keys in a m-of-n transaction?

Assume that Alice is controlling an address that requires multisig to spend bitcoins. Someone wants to send Alice bitcoins and this sender needs to create a `scriptPubKey` as part of the output paying Alice.

The `scriptPubKey` in the sender’s transaction should look like this:

``````m pubKey_1, pubkey_2, ...pubKey_m n OP_CHECKMULTISIGVERIFY
``````

How does the sender know the public keys to send funds to Alice? And further more, how does the sender know the value of `m`? Isn’t it more logical that Alice determines what the minimal number of signatures is?

If I understood correctly this output format is not used anymore, but I still want to understand how it worked.

## 2013 – Are event receivers supposed to handle events of editing the list itself?

I just noticed that our list item event receivers are running when we are updating the list itself. I thought these should only trigger when modifying list items in the list, and not that they would trigger on modifications on the list itself.

Is this expected behavior or have we configured something strange here?

## sharepoint online – Reference / Update the current item in the remote event receivers ItemAdded / ing and ItemUpdated / ing, is it available in SPRemoteEventProperties

I am working on remote event receivers, and say I want to update a ProjectID deposited in my ItemAdded, currently I am running a CAML request to get the current item >> update the ProjectID, as follows: –

``````public void ProcessOneWayEvent(SPRemoteEventProperties properties)
{
var listItemID = properties.ItemEventProperties.ListItemId;
var listTitle = properties.ItemEventProperties.ListTitle;
using (ClientContext context = Helpers.GetAppOnlyContext(properties.ItemEventProperties.WebUrl))
{

CamlQuery camlQuery = new CamlQuery();
context.ExecuteQuery();

string webrelativeurl = context.Web.ServerRelativeUrl;

camlQuery.ViewXml = string.Format("{0}", listItemID);
ListItemCollection collListItem = context.Web.GetList(webrelativeurl + "/lists/" + "Projects").GetItems(camlQuery);
item => item.Id,
item => item("ProjectID"),
item => item("ID"),
item => item.RoleAssignments.Include(roleAssigned => roleAssigned.Member.Title, roleAssigned => roleAssigned.RoleDefinitionBindings)

));
context.ExecuteQuery();
//get the template id based on the entered Purpose

foreach (ListItem currentFilingSystemItem in collListItem)
{

ListItemCreationInformation listItemCreationInformation = new ListItemCreationInformation();
ListItem listItem = context.Web.GetList(webrelativeurl + "/lists/" + "Projects").AddItem(listItemCreationInformation);

listItem("ProjectID") = "ARQ-Project-" + listItem("ID");
listItem.Update();
``````

So is my approach correct? or can I reference the current item directly instead of getting it through CAML? the problem is i can't reference `properties.ListItem` as in server side event receivers.

## USB drive – Where are the drivers stored on the USB receivers?

I wonder where the firmware / driver is stored on these devices? If it can't be used as a storage device, how could it possibly store firmware for itself?

How can I access these "files"? I cannot access the player as I would with a normal storage device.

Can a USB receiver be used as a USB stick?

I'm working on a solution that will need to detect when a page is created on prem site (sharepoint 2016), then use the information from the page to create an online list item (sharepoint o365)

My initial approach was to create an event listener able to listen to an item being published and then run it. However, I do not find any specific reference to the configuration of 2016 event receivers, mainly from 2010 – something I miss?

I would appreciate that anyone who has managed to find an event listener in 2016 can point me in the right direction, or if my approach is not feasible if you could let me know.

## sharepoint online – Functions we can have inside remote event receivers

I have a SharePoint 2013 site on site and the site has a custom list. An event sink is associated with this list. The event recipient performs the following steps when an item in the list is trusted:

1. Create a new subsite with the help of a custom site template. the URL of the subsite will be equal to the list item ID. In addition, the description of the subsite will be equal to the description field of the list item.
2. Define that the new subsite will have unique permissions.
3. Create 2 SharePoint groups, add users to them, and associate them to the new subsite.
4. modify the navigation on the left to have links to the new security groups.
5. Similarly, when the description of an item in the list is updated, the description of the associated subsite is updated.

Now, I want to migrate my site collection to SharePoint Online and I will convert the event receiver above to a Remove event sink, which will proceed exactly as above, but instead of creating a subsite, the Remove event receiver will do these steps: –

1. create a new collection of modern team sites.
2. Link the new collection of modern team sites to a modern hub site.
3. Since we can not create a new modern team site collection from a site template (as in the case of subsites), I will need to create custom lists and custom document libraries. For example, I will have to create a custom content type >> add a managed metadata site column (which will be linked to a set of terms) >> create a new document library in the new site collection that will use the type of custom content.
4. perform all other operations as defined in the server-side event receiver above.
5. In addition, I need to change the defualt permission level for the group of modern team site members to edit to contribute.

in general, should I be able to develop an event delete recipient that can perform all of the above steps?