Decryptor requests encryptor's data by posting a data request to the ledger through this endpoint. After sufficient number of trustees and validators observe the data request and have responded to it, the decryptor will be able to decrypt the secret.
The data request is successfully posted on the ledger.
Example
400 Bad Request
Input is malformed. Check that:
token is a string
token is a 128-bit hex string
Example 1
Example 2
401 Unauthorized
API key is missing or incorrect.
Example
409 Conflict
The data request has already been posted.
Example
Get ciphertext
GET /encryptions/{token-hash}/ciphertext
Description
Retrieve the ciphertext part of an Encryption. After decrypting it with decryptor's decryption key, one should find a payload encrypted with a symmetric key together with a digital signature by the encryptor. The decryptor will not have sufficient information to further decrypt unless there are anough trustees and validators who have responded to the data request. See the code samples to see how decryptions are done.
Retrieves all trustee responses for a data request signed by the corresponding Trustee. Sufficient number of individual trustees' responses reconstruct to a masked symmetric key. See code samples for details.
Note 1: The path parameter is the token which should be kept secret until the data request related to the token has been posted. Therefore, this endpoint should be called only after the data request is posted onto the ledger.
Note 2: This endpoint returns successful status even if not enough trustees have responded. User should check if the number of responses is at least the secret sharing threshold before attempting to reconstruct the secret. Otherwise a garbage value will be reconstructed.
Retrieves all validator responses for a data request signed by the corresponding Validator. Sufficient number of individual validators' responses reconstruct to a mask that together with trustees' responses reveals a symmetric key. The combined results also reveals the decryptor's identity. See code samples
Note 1: The path parameter is the token which should be kept secret until the data request related to the token has been posted. Therefore, this endpoint should be called only after the data request is posted onto the ledger.
Note 2: This endpoint returns successful status even if not enough validators have responded. User should check if the number of responses is at least the secret sharing threshold before attempting to reconstruct the secret. Otherwise a garbage value will be reconstructed.
A piece of asymmetrically encrypted ciphertext. It is created by first generating a symmetric ephemeral key, encrypt symmetrically the message using the ephemeral key, then encrypt asymmetrically the ephemeral key by an encryption key. All binary data are encoded in base64. For details, read the code samples.
Example
Schema
Name
Type
Required
Restrictions
Description
encryptedMessage
object
true
none
Cipher of a message encrypted with an ephemeral key
The ephemeral key encrypted by an asymmetric encryption key
Base64
A base64-encoded binary data.
Example
Schema
Type
Restrictions
string
none
Token
A 128-bit random string kept secret between the encryptor and decryptor after encryption stage and before data request stage. It identifies a data request. Its hash value identifies an encryption. The decryptor posts it on the ledger at data request stage.
Example
Schema
Type
Restrictions
string
/[0-9a-fA-Z]{32}/
Sha256
A Sha256 hash value as a hexidecimal string.
Example
Schema
Type
Restrictions
string
/[0-9a-fA-F]{64}/
TrusteeId
ID of a trustee. It contains only alphanumerical characters, underscores (_) and dashes (-). It has length inclusively between 3 and 30.
Example
Schema
Type
Restrictions
string
[a-zA-Z0-9-_]{3,30}
ValidatorId
ID of a validator. It contains only alphanumerical characters, underscores (_) and dashes (-). It has length inclusively between 3 and 30.
Example
Schema
Type
Restrictions
string
[a-zA-Z0-9-_]{3,30}
ApiResponse
Example
Schema
Name
Type
Required
Description
ok
boolean
true
The request is successful or not
message
string
true
none
TrusteeResponse
A trustee response to a data request. It contains the decrypted trustee share for the decryptor to perform a full decryption on a secret. It also consists of metadata for identifying the corresponding data request.