Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6084135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:29:09+00:00 2026-05-23T11:29:09+00:00

Suppose I have a server which is publishing information (e.g. via a message bus)

  • 0

Suppose I have a server which is publishing information (e.g. via a message bus) to four parties: A, B, C and D. All traffic can be discovered in encrypted form by any party. In order to make use of the information, obviously it would need to be decrypted:

  • Party A should be able to read all information (i.e. decrypt information intended for A, B and C)
  • Party B should be able to read information intended for B and C
  • Party C should only be able to read information intended for party C
  • Party D should be able to read information for B and D

Obviously this could be achieved by having completely separate public/private key pairs for each party and then sharing the private keys as per the requirements above. Unfortunately this does not scale nicely to hundreds of parties.

Is there a better way?


EDIT

Basically, what I would like to do is for each person to have their private key and for me to say, when encrypting a message, that it is encrypted with key = A | B | C such that this means that a person with any of key A, B or C can decrypt it. Imagine a trunk which can have n locks fitted to it, any of which can open the trunk.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:29:10+00:00Added an answer on May 23, 2026 at 11:29 am

    What you want can be achieved using normal protocols based on public key cryptography. The Bouncy Castle Crypto APIs has support for both OpenPGP and CMS, either of which can work from Scala.

    TO set everything up:

    • Every party is given a public/private key pair.
      • No one EVER shares the private key. The private key must stay private
    • Every party knows every other party’s public key

    The protocols allow encryption using multiple public keys. For example, if you use something like the PGPEncryptedDataGenerator, then you would call the addMethod(PGPPublicKey) method for every recipient you wish to be able to decrypt the message.

    There are a lot of nuances to the API’s, but the unit tests and examples will really help you navigate them.

    Implementation Details

    Both protocols work in fundamentally the same way.

    1. Securely generate a random symmetric key
    2. For every recipient, encrypt the symmetric key with the recipient’s public key. All of the encrypted public keys are written into a message header.
    3. Encrypt the message using the symmetric key. This becomes the message content.

    Recipients reverse the process to decrypt the message

    1. Search message header for key addressed to self.
    2. Use private key to decrypt symmetric key.
    3. Use symmetric key to decrypt the message content.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a server that runs on Linux on which I would like
Suppose, I have a webserver which holds numerous servlets. For information passing among those
Suppose I have static ip in a subnet that has DHCP server. If i
Let's suppose I have xml like this one: <Server Active=No> <Url>http://some.url</Url> </Server> C# class
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily
I have a remote server which handles various different commands, one of which is
Suppose that I have a test server with a large group of test accounts.
Suppose I have an application that access data resident in a central DB server
I have a UIWebView which loads videos from an external server. The code seems
I have a string coming from server which I am displaying on UILabel. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.