title: Cretate multiple shared secrets in a (selfmade) public/privavte key infrastructure
body: <p>I just try to understand cryptography, please be concern. Its not meant to be secure or professional. I create 3 numbers for each party. a public key, a secret key and a modulus. The first party (A) creates his keys</p>
  
  <pre><code>let pri = 133
  let mod = 256
  let pub = mod - pri
  </code></pre>
  
  <p>and shares "mod" and "pub" to other partys (B, C). When B want to encrypt a string he takes A's public key and modulus and do</p>
  
  <pre><code>// B encrypts
  let enc = ( input + pubA ) % modA
  </code></pre>
  
  <p>A on his side is doing</p>
  
  <pre><code>// B decrypts
  let dec = ( enc + priA) % modA
  </code></pre>
  
  <p>to decrypt it. My problem is, i can create multiple keypairs but only 1 associated public key to each secret key because i have to share the modulus of each pair for en/decryption. </p>
  
  <p>Is it possible (in this situation) to create multiple publics numbers for a single private number? And if so, how can i do it?</p>
  
  <p>Thank you (and sorry if this is a poor question)</p>
  
  <p><strong>EDIT</strong> Even if its not "good" to create your own cipher i want to do so..</p>
  
  <p>I recognized that i missed the secret exponent d so that phi divides (e * expo)-1. </p>
  
  <pre><code>/* Pseude code */
  
  p = q = primes()
  n = p * q
  phi = (p-1) * (q-1)
  
  e = 3
  d = ? // &lt;-- have to find my own secret exponent!
  
  if( gcd(e, p-1) != gcd(e, q-1) ) exit(0)
  
  expo = 0
  for(expo &lt; 100000)
      if( (e * expo)-1 == phi ) ) d = expo
  </code></pre>
  
  <p>And therefore i could have</p>
  
  <pre><code>public(n,e)
  private(n,d)
  </code></pre>
  
  <p>so i can share (n,e). Is that correct?</p>