English 中文(简体)
是否有可能与多个私人钥匙进行加密?
原标题:Is it possible to have encryption with multiple private keys (PHP)?

www.un.org/Depts/DGACM/index_spanish.htm 或者:如何储存用户的加密数据?

我承认,这是一个不容置疑的问题,私人钥匙仅限于一个人,因为这个术语已经意味着。 但我有以下设想:

用户Tom输入需要储存在数据库中的数据。 用户决定希望向Jim和Bob提供这一信息。 用户John和Jayne不能加以加密。 当然,也不要让用户时间对服务器进行 ha缩,并能够查阅加密数据和进行加密/加密的文字。

我认为与PHPs(opensl_public_en加密/a> 由于两个用户需要具备“私人”数据加密的关键,因此功能在这里赢得了t工作。

我猜想这个相当一般性的问题,但如果这个问题很重要,就必须在公共卫生和公共卫生部(和MySQL可能)中处理。

最佳回答

That s how it done in OpenPGP (and, other systems): - you are generating secret symmetric key, which is used to encrypt the data itself; - then, this symmetric key is encrypted with Tom s key; - also, symmetric key can be encrypted with Jim s and Bob s public key, allowing them to decrypt the key and after that to decrypt the data

问题回答

PHP提供这一功能: opensl_seal(。 这项职能涉及一系列公共钥匙,并对数据进行加密,以便任何相应的私人钥匙均可用于加密(http://php.net/openssl_open> opensl_open(/a>)。

我没有PHP的图书馆。 但总的来说,程序如下:

  • Data is encrypted using a symmetric key
  • For each recipient, key is encrypted using the public key of recipient
  • All this is saved in a PKCS#7 file structure

在研究“PHP和PKCS7”时,应当取得一些成果。

Use a data encryption key (call it Kgeneral) that s distinct from Tom s key.

• 给Tom公用钥匙的“普通”加密,并向Tom提供结果——他可以使用其私人钥匙进行加密并获取Kgeneral。

如果另一个用户需要获得数据,那么Tom(或您的申请)可以将其公用钥匙加密,并允许他查阅。





相关问题
Extend Contacts application on Android to provide encryption

I want to encrypt individual contacts stored by the Contacts application on Android based on user s preference. So, I am thinking I ll have to hook/extend the Contacts application before the it stores ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

Thread & Queue vs Serial performance

I though it ll be interesting to look at threads and queues, so I ve written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I m still very new ...

Convert PHP encryption code to C#

I m trying to convert this piece of code from PHP to C#. It s part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = ...

Encryption: how to have 1 iv despite multiple fields

I ve been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I m encrypting an address and I ...

热门标签