rsa-proxy-reencrypt
Proxy Re-encryption library for Javascript using RSA cryptography
Introduction
This library is based on the suggested implementation in Section 4.3, Dodis, Y. and Ivan, A. 2003. Proxy cryptography revisited. In Proceedings of the Tenth Network and Distributed System Security Symposium..
This package is intended as native Javascript implementation which allows the following functionality:
- Encrypting data*
- Decrypting data**
- Generating Re-encryption keys***
- Re-encrypting data***
*Data must currently be a string **Data must have been encrypted using this scheme ***Not-yet implemented
Usage
Encrypting data
// Generate a key / Use existing keyconst rsa = forgepkirsaconst key = rsa // Get a data urlconst data = const encrypter = rsa: key const encrypted = encrypter
Decrypting data
// Use existing keyconst rsa = forgepkirsaconst key = rsa const encrypter = rsa: key // Assume encrypted is data previously encrypted by this schemeconst decrypted = encrypter
Generating Re-encryption Keys
Proposed
Reencrypting data
Proposed
// Use existing keyconst rsa = forgepkirsaconst ownerPrivateKey = rsaprivateKeyconst userPublicKey = rsapublicKey // ------------------------------------------------------------// OWNER// ------------------------------------------------------------const encrypter = rsa: privateKey: ownerPrivateKey const proxyKey userKey = encrypterconst ownerDecryptable = encrypter // ------------------------------------------------------------// PROXY// ------------------------------------------------------------const proxyEncrypter = rsa: privateKey: proxyKey const userDecryptable = proxyEncrypter // ------------------------------------------------------------// USER// ------------------------------------------------------------const userEncrypter = rsa: privateKey: userKey const message = proxyEncrypter