Date Preparatoin and Encryption
RSA Encryption
To ensure the security and integrity of the data being sent to the Hyperhashing API, we use RSA encryption. This section outlines the steps required to generate RSA keys and how to use them for encrypting data before making API requests.
Generating RSA Keys
Generate RSA Key Pair: Users need to generate an RSA key pair (public and private keys). The public key will be shared with Hyperhashing, while the private key will be kept secure by the user.
Share Public Key: Once the RSA key pair is generated, the user must provide Hyperhashing with their public key. This key will be used by Hyperhashing to decrypt the data sent by the user.
Generating RSA Keys Using OpenSSL
Step 1: Install OpenSSL
If you don't have OpenSSL installed, you can install it using your package manager. For example, on Ubuntu, you can install it with:
Step 2: Generate the RSA Private Key
To generate a 2048-bit RSA private key, use the following command:
This command generates a private key and encrypts it with AES-256. You will be prompted to enter a passphrase to secure the key.
Step 3: Generate the RSA Public Key
Once you have the private key, you can generate the corresponding public key with:
This command reads the private key and outputs the corresponding public key.
Sharing the Public Key
The public key generated in the above step should be securely shared with Hyperhashing.
Encrypting Data
Once the RSA keys are set up, the user can proceed to encrypt the data before sending it to the API. The data is first converted to a JSON string and then encrypted using the private key.
Encrypting Data
Once the RSA keys are set up, the user can proceed to encrypt the data before sending it to the API. The data is first converted to a JSON string and then encrypted using the private key.
Here is an example of how to encrypt data using the node-rsa
library:
Example Request Preparation
After encrypting the data, the user can prepare the API request as follows:
In this example, the data object is encrypted using the user's private RSA key, and the resulting hash is included in the API request.
Last updated