Randomly assign n elements to n agents such that each agent only knows its own element


I’m working on an app that involves shuffling and distributing playing cards to players. As a challenge, I tried to solve this problem in a way that doesn’t require a trusted intermediary.

In other terms, the task is to find a distributed algorithm that

  • uniquely assigns $ n$ agents numbers $ 1..n$
  • allows each agent to know nothing about the assignment but its own
  • when revealing the assignment, allows other players to verify the assignment

We also assume that knowing other’s assignment is an advantage for each agent, and revealing its own prematurely a disadvantage. Agents are also assumed to be able to talk with each other in a way hidden from all other agents.

Partial solution

The solution I came up with works only under the assumption that adversaries do not collaborate.

The idea is to create a set of $ n$ nonces, and assign each agent exactly one nonce. The set is then passed from agent to agent in an agreed upon order, hidden from all others, until each agent received the set exactly once. Each time an agent receives the set, it swaps its nonce with a new one, memorizes the new nonce, and confirms receival of the set to the others. This entire procedure is done twice, at which point, all agents have received the set at least once after all other agents swapped their nonces, making it impossible to recognize and hence map the nonces to the other agents.

When the last agent receives the set the second time, it shares it with everyone, and all agents confirm to the others that their nonce is contained in the set. The agents then assign a number to each nonce in the set based on an agreed upon random seed, giving us the required unique assignment.

To allow ownership verification, instead of the nonces, agents put the hash value of their nonce on the set, revealing the actual nonce only when verification is required.

The problem with this solution is that if adversaries are allowed to collaborate, each time an adversary receives the set, they can compare their versions, identify changes and potentially derive which nonce belongs to other agents, allowing them to know what number got assigned to them.

All ideas are appreciated!

GPG Agent SSH Forward Pinentry

I have GPG agent forwarding via SSH RemoteForward working up to a point.

I can list my private and public keys on the remote host.

If I try to decrypt a file remotely, the PIN is prompted for but the text is stepped, garbled and the passphrase prompt echoes the passphrase (at least several random chars).

I can skip the forwarding and SSH to said remote host and start an agent, use the local keyring and PIN entry works fine. Similarly, I can SSH from the remote host (VM) back into MacOS and the same local keyring PIN entry works.

It’s ONLY the forwarding that breaks PIN entry. I have exported "$ GPG_TTY" and do "gpg-connect-agent UPDATESTARTUPTTY /bye" before SSH so the prompt is in the correct tty. That part does work as I’ve experimented with and without said vars.

Any help is greatly appreciated as I’m out of ideas. Aah, after writing I found the below, exact same problem!


  • MacOS Catalina to CentOS 8.2.2004
  • GPG 2.2.9 on CentOS8
  • GPG 2.2.21 on MacOS installed via homebrew
  • Pinentry 1.1.0 on MacOS and CentOS8
102-182-155-35 :: ~ % cat .ssh/config Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" Host centos8.ephemeric.local centos8   Hostname   ForwardAgent yes   StreamLocalBindUnlink yes   RemoteForward /run/user/1000/gnupg/S.gpg-agent /Users/robert/.gnupg/S.gpg-agent.extra 
102-182-155-35 :: ~ % cat .gnupg/gpg-agent.conf pinentry-program /usr/local/bin/pinentry-tty pinentry-timeout 10 debug-level guru allow-preset-passphrase default-cache-ttl 43200 default-cache-ttl-ssh 43200 max-cache-ttl 43200 max-cache-ttl-ssh 43200 
centos8 :: ~ % gpg -d tmp/slobwashere.gpg Note: Request from a remote site.                                   Please enter the passphrase to unlock the OpenPGP secret key:                                                                                               "Robert Gabriel (Slob) <ephemeric@icloud.com>"    4096-bit RSA key, ID DC141A1E1314AB17,                                          created 2018-07-23 (main key ID 458EF10593DA8C1D).                                                                                             Passphrase:                                                                                                        gpg: encrypted with 4096-bit RSA key, ID DC141A1E1314AB17, created 2018-07-23       "Robert Gabriel (Slob) <ephemeric@icloud.com>" gpg: public key decryption failed: Timeout gpg: decryption failed: No secret key 

Is there a reasonable chance of a well-funded agent obtaining raw traffic over Tor circuits

If an agent has a few middle Tor relays (Am) and a few exit Tor relays (Ae), could they obtain the original traffic of some of the circuits with a reasonable probability?

Let’s assume, without too much loss of generality, that Tor only uses middle-middle-exit circuits and that there are M middle relays and E exit relays.

The probability of such a circuit consisting only of nodes this agent controls then is:

P = Am/M * (Am - 1)/(M - 1) * Ae/E 

According to Tor Metrics, there are just short of 7000 relays in total, with almost 2000 being exit relays. I will round these figures up into 7000 – 2000 = 5000 middle relays and 2000 exit relays.

Assuming the attacker owns 10 middle relays and 10 exit relays, the probability of them getting to control the whole circuit is

P = 10/5000 * 9/4999 * 10/2000 ~= 1.8e-8 

which is very low. However, once you factor in the enormous amount of Tor circuits being established (could not find a reliable figure anywhere, will gladly edit one in if someone has it), wouldn’t this agent be able to consistently get complete circuits through their relays and, as a consequence, have complete access to the data it was relaying?

I understand that some of the data through the circuits would also be using TLS, but at least some of it should be plaintext.

It may also be worth pointing out that if this is a really well-funded agent, they might have substantially more than 20 relays at their disposal.

SQL Server Agent unable to view network drives

I am unable to get agent jobs to output to a network path. I have pushed the IT guy to set up a domain authenticated user that logs in when the agent starts. That login does have access to the domain and is able to see the network drives. If I set the location of the output file to be the local c: then this works without issue. However if I set the drive to be a network location I get the following message;

[SQLSTATE 01000] (Message 0)Unable to open Step output file. The step succeeded. 

Any help would be very much appreciated

SQL Server Snapshot replication – Failing to start the Publisher snapshot agent

I am trying to set up a Snapshot replication using an Azure SQL Managed Instance. While trying to see the Snapshot Agent status, I see this error. Failed to connect to Azure Storage ” with OS error: 53.

While configuring the Distribution wizard, I had the option to set the Snapshot folder as well as the Storage account connection string.

I got the storage account connection string from the Azure Portal and pasted that in. I am in doubt about the Snapshot folder. What value should I set in there ?

Is it a folder inside Azure Storage account or in the Distributor SQL Server instance ? In the Distribution wizard, it said, that the details of the folder would also be in the Azure portal. Is there a place where I could get it ?

I am getting a feeling that if I have the correct setting for this, my snapshot replication would work just fine.

Can anybody guide me to find out the problem ?

Unity: How to prevent animation from twitching when combined with Navmesh Agent

I am trying to make a third person shooter in Unity and trying to implement a zombie that follows the player and when close to player, attack animation is played. I am using the NavMesh Agent for that purpose. But I am facing the problem that once the zombie comes close and if the player moves back or side ways, the zombie twitches and the transition between the walking and attacking animation appears broken. Also, it slides on the floor around the player. Here is the video of it: Video Here is my code to control the zombie movement:

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI;  public class ZombieController : MonoBehaviour {     public Animator animator;     public NavMeshAgent agent;     public GameObject player;      public float turnSmoothing = 15f;               public float speedDampTime = 0.1f;     private const float stopDistanceProportion = 0.1f;      private int health = 100;      private PlayerContorller pc;      // Start is called before the first frame update     void Start()     {         agent.updateRotation = false;         agent.SetDestination(player.transform.position);         agent.isStopped = true;         pc = player.GetComponent<PlayerContorller>();     }       // Update is called once per frame     void Update()     {         agent.SetDestination(player.transform.position);          if (agent.pathPending)             return;         float speed = 0.0f;         if (!pc.Dead)         {             if (agent.remainingDistance <= agent.stoppingDistance * stopDistanceProportion)             {                 agent.isStopped = true;                 animator.SetBool("PlayerClose", true);                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);             }             else if (agent.remainingDistance < 70.0f)             {                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);                 float proportionalDistance = 1f - agent.remainingDistance / agent.stoppingDistance;                  speed = Mathf.Lerp(0.5f, 1f, proportionalDistance);                 agent.isStopped = false;                 animator.SetBool("PlayerClose", false);             }             else if (agent.remainingDistance < 100.0f)             {                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 float proportionalDistance = 1f - agent.remainingDistance / agent.stoppingDistance;                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);                 speed = Mathf.Lerp(0f, 0.5f, proportionalDistance);                 agent.isStopped = false;                 animator.SetBool("PlayerClose", false);             }         }         else         {             agent.isStopped = true;             animator.SetBool("PlayerClose", false);             speed = 0f;         }         animator.SetFloat("Speed", speed);     }      public void Hit()     {         health -= 10;         if(health == 0)         {             animator.Play("Die");             StartCoroutine(Die());          }     }      IEnumerator Die()     {         yield return new WaitForSeconds(10);         Destroy(gameObject);     } } 

The Speed parameter controls Idle (when 0), walking (0-0.5), running(0.5-1) of the zombie, all three are part of a blend tree. And when the PlayerClose parameter is set to true, the animation transitions to the attack animation. How do I fix this? what changes to make in order to fix that?

User Agent

Hello @Sven
I would like to know if a user agent is used when checking link ? 

If yes, is it unique or randomized?
When going from page to page, is the link similar to a visit?
My question comes down to whether the link is “activated” by something that looks like a normal visit for Google.

Since a lot of sites use the tracking script, Google probably comes to know if which way the visitors comes … or bots. They could be wise to modify the IP headers and even to let load the famous tracking script for Ser manual verification ….

What user agent does Amazon WorkMail use? [closed]

I recently had a spike of clicks on my newsletter, which is sent with tls encryption, but most of them seems to originate from ec2 instances with this user agent : “Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36”.

Can anyone advise as to the reason for it ? (the subscribers are not that tech-savy)

Copy last modified backup files from network path into SQL server box and restore them using Agent job

I have to copy latest full backup from a network path and bring that to my SQL server for restore, I have to do that using agent job.

I know i can use xcopy: source and destination, but that wouldn’t give me latest modified file, can you please help ?

Thanks, learner