Decrypt
This API decrypts data using key specified by name.
URL
<http/https>://<host-name>:<Port>/protectappws/services/rest/decrypt
Input Parameters
Parameters | Description |
---|---|
username | User name (optional). |
password | Password associated with the user (optional). |
keyname | Name of the key to be used for decryption. |
ciphertext | Encrypted data represented in Hex. |
keyiv | Optional/blank. If blank, the key’s default IV is used, else, specify in IV in Hex characters. The number of Hex character must be specific to the transformation used. |
transformation | Transformation to be used. For example: AES/ ECIES/CBC/PKCS5Padding. For more information on supported ECIES transformations, refer to the CipherTrust Application Data Protection for Java User Guide. The ARIA and SEED algorithms are not supported by CADP for Java WebServices. |
outputformat | Displays output in following formats are: HEX, STR (default), and BASE64. This parameter is optional. |
certAlias | Client certificate alias for making SSL connections (optional). |
certPass | Password for the provided certificate alias (optional). |
Sample REST call for cxf
request
{
"Decrypt": {
"username": "cryptouser",
"password": "safenet123",
"keyname": "testKey",
"keyiv": "12345678123456781234567812345678",
"transformation": "AES/CBC/PKCS5Padding",
"ciphertext": "100010EBF1B02D8CFAC300502398BD7FD5DB1A",
"outputformat": "STR"
}
}
response
{
"DecryptResponse": {
"plainText": "hello world!"
}
}
Sample SOAP Parameters
Plaintext data.
<prot:Decrypt>
<!--Optional:-->
<username>cryptouser</username>
<!--Optional:-->
<password>qwerty1234</password>
<keyname>aes256vt</keyname>
<ciphertext>10009046C980ECAFC6A79765A7ABAE01C846C5</ciphertext>
<!--Optional:-->
<keyiv></keyiv>
<transformation>AES/CBC/PKCS5Padding</transformation>
<!--Optional:-->
<outputformat>STR</outputformat>
</prot:Decrypt>
output
Plaintext data.
<ns1:DecryptResponse xmlns:ns1="http://dsws.org/protectappws/">0000111122223333</ns1:DecryptResponse>
Note
In almost all cases the keyiv and transformation should not be specified: It is a useful practice to utilize the Key Manager appliances capability to store the IV for the application and AES/CBC/PKCS5Padding – the default - is the most recommended cipher block mode.
If the decrypted
outputformat
is base64 encoded and the length of the ciphertext is quite large, '\n' is appended for new line.