Users can register on the page and leave some sensitive data (no credit card data, but age, name, address and such) and this is then stored in a DBdatabase. My customer then can access the page and download the data through a "safe" connection.
I am using Drupal as a backend to facilitate the secure access to the page (SSL) for my customer (the users don't have to login). In addition to the Drupal password I gave my customer the passphrase for the private key, which (iI know not good), is stored alongside the public key. The passphrase the customer sends (after logging in to Drupal) is not stored on site, but directly used to decrypt the privatekeyprivate key, which in turn is used to decrypt the data stored in the DB. The result is then sent back as a CSV file to my customerscustomer's computer.
I told my customer that this situation is not optimal, that the best thing would be to decode only on the client side via an extra software and download only the encoded data to keep the private key out of harmsharm's way, or to get more servers and change the setup, but this is not possible.
I know an exact assesmentassessment is not possible, but I was wondering how critical the fact that I have hundreds or thousands of datasets encoded with the same publickpublic key would heighten the risk of anybody getting to the data via access to the DB, or by reading the keys somehow (the encyptedencrypted one of course).
I know the achillesAchilles' heel here is the private key that is stored on the server, so how easy is the private key passphrase to hack?
Heeding IlmarisIlmari's advice I modified my setup and ended up with the following:
- PHP Script PROCESSFORM receives data from an HTML form (SSL) and validates/purges it
- PROCESSFORM adds a delimiter character before and after each entry and paddspads the spaces between the entries with random characters so that the DATASET string has always the same size
- the DATASET is encoded using a public key and stored in the DB together with a cleartext unique ID and DATEADDED (DB table has three fields, ID, DATEADDED, ENCODEDDATA)
- The user loggslogs into a backend with username/password (SSL)
- The user then has to enter a passphrase which is sent via a form
- PHP Script DECODER receives the passphrase and
- Uses a PBKDF2 implementation to "harden" the key
- UseseUses the "hardened" key to decrypt the private key which is also stored on the server to decode the data from the DB
- Removes the padding from the decoded string
- Creates a CSV with the resulting data and serves it to the user
Although the fact that the private key is stored alongside the public key on the server is not ideal, it was not possible to sway the client to decode the data on his own computer, it had to be via a web-interface interface.
But as I used PBKDF2 to "harden" the key and therefore significantly increased the time necessary to try a key, it is most definatelydefinitely not worth the final result (only semi-sensitive address data, no credit cards or anything).