spikex / strongbox

Secures ActiveRecord attributes with public key encryption
http://stuff-things.net/2009/04/17/introducing-strongbox/
MIT License
397 stars 43 forks source link

Per-Compnay encryption settings #29

Open khelal opened 11 years ago

khelal commented 11 years ago

Hi,

This is not actually an issue, but rather a set of questions. We're faced with a tough problem and it looks like your gem might actually help us. Here's our case:

Our system has multiple companies
Each company has multiple users
Each company can create multiple auctions
Other companies can then submit their bids for the available auctions.
The prices for the bids will be saved as integers (cents) and as such will always be smaller than 245 bytes per price.

The problem that we're facing is that our customers do not want us to ever have access to the bid prices, for security reasons.

Here's what we thus thought of doing:

When a company signs up, we create a public/private keypair for it. Each company in the system thus have it's own fixed pair that cannot be changed once created. The password of the keypair is not saved into the database and must be entered every time its required by a user of the company.

When a company submits a bid, we encrypt the data using the auction's owner company to encrypt the data. When the prices then have to be made public, we ask the issuing company for their password and use their own private key to decrypt the prices using their own private key.

SO here are the questions (and we're unfortunately not security experts, so sorry if those are stupid questions)

Thanks!