Decrypt
    • PDF

    Decrypt

    • PDF

    Article summary

    Summary

    Decrypt the ciphertext with a specified master key. The KMS prefix must be specified exactly with the ciphertext because it will be decrypted with the key version specified in the decryption request. The request can only be made with the key type used for encryption and decryption.

    POST https://kms.apigw.ntruss.com/keys/v1/{keyTag}/decrypt
    POST https://kms.apigw.ntruss.com/keys/v2/{keyTag}/decrypt
    

    Request

    Request parameters

    Parameter nameTypeDescription
    keyTagString (Required)Tag value of the master key to use for the decryption

    Request body

    {
      "ciphertext": string or string list,
      "context" : string
    }
    
    Parameter nameTypeDescription
    ciphertextString or String List (Required)- Data to decrypt
    Must consist of a KMS prefix and a Base64-encoded ciphertext
    List can be up to 32 KB for all items combined
    contextString (Optional)- Context data (up to 50 bytes)
    Need to be Base64-encoded
    Required only for AES-256 key type with convergent encryption

    Request body example

    {
      "ciphertext" : "ncpkms:v1:+xQZ2wyDin4vK7O4tue8QSnFB9Tu8MjiE1xTlhlGnrM=",
      "context" : "dGhpcyBpcyBhIHRlc3QgY29udGV4dA=="
    }
    or
    {
      "ciphertext" : ["ncpkms:v1:+xQZ2wyDin4vK7O4tue8QSnFB9Tu8MjiE1xTlhlGnrM=", "ncpkms:v1:QoRYNd8LxURIEWpwMBRS0Sntv5Zx5cl78dWCTB1T2Ic=", "ncpkms:v1:wPgBmRczInROzKqvnStna9vMX7Q+tApFX8Xh4xGWPL4="],
      "context" : "dGhpcyBpcyBhIHRlc3QgY29udGV4dA=="
    }
    

    Response

    Response body

    {
      "plaintext" : string
    }
    or
    {
      "plaintextList" : [string, string, string]
    }
    
    Parameter nameTypeDescription
    plaintextString- Plaintext data
    Base64 encoded
    Returned if requested as a string type
    plaintextListString List- Plaintext data
    Base64 encoded
    Returned if requested as a string list type

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.