Encrypt
    • PDF

    Encrypt

    • PDF

    Article Summary

    Overview

    Encrypts data of up to 32 KB, with the current version of the specified master key. Only a key type for encryption and decryption can be specified.

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

    Request

    Request parameters

    ParameterTypeRequiredDescription
    keyTagStringYTag of the master key for encryption.

    Request body

    {
      "plaintext" : string
    }
    
    ParameterTypeRequiredDescription
    plaintextString or List of StringsYData to encrypt (up to 32 KB)
    (It needs to be Base64-encoded.)
    contextStringNContext for key derivation (up to 50Byte)
    (It needs to be Base64-encoded.)
    Required only for Convergent Encryption

    Example of Request body

    {
      "plaintext" : "dGVzdA==",
      "context" : "dGhpcyBpcyBhIHRlc3QgY29udGV4dA=="
    }
    Or
    {
      "plaintext" : ["dGVzdA==", "dGVzdDI=", "dGVzdDM="],
      "context" : "dGhpcyBpcyBhIHRlc3QgY29udGV4dA=="
    }
    

    Response

    Response body

    {
      "ciphertext" : string
    }
    
    FieldTypeDescription
    ciphertextStringCiphertext
    (It consists of a KMS prefix and Base64-encoded ciphertext.)

    Roles

    Manager, Encryptor, Encryptor/Decryptor


    Was this article helpful?

    What's Next
    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.