Files
doc-exports/docs/kms/umn/dew_01_0215.html
qinweiwei 3e4721c813 KMS UMN 20251111 version
Reviewed-by: Rogal, Marcel <mrogal@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qinweiwei <qinweiwei@huawei.com>
Co-committed-by: qinweiwei <qinweiwei@huawei.com>
2026-01-19 09:05:54 +00:00

16 lines
1.3 KiB
HTML

<a name="dew_01_0215"></a><a name="dew_01_0215"></a>
<h1 class="topictitle1">What Is the Relationship Between the Ciphertext and Plaintext Returned by the encrypt-data API?</h1>
<div id="body0000001553988089"><p id="dew_01_0215__p8578174683513">The basic length of the ciphertext returned by the encrypt-data API is 124 bytes. The ciphertext consists of multiple fields, including the key ID, encryption algorithm, key version, and ciphertext digest.</p>
<p id="dew_01_0215__p8060118">The plaintext has 16 bytes in each block. A block with fewer than 16 bytes will be padded. Ciphertext length = 124 + Ceil(plaintext length/16) x 16. The conversion result is encoded using Base64.</p>
<p id="dew_01_0215__p12190103763610">Take 4-byte plaintext input as an example. The calculation result is 124 + Ceil(4/16) x 16 = 140. The 140 bytes are converted into 188 bytes after Base64 encoding.</p>
<div class="note" id="dew_01_0215__note1018643711361"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dew_01_0215__p129731738123610">Ceil is a round-up function. Ceil(a) = 1. The value range of <strong id="dew_01_0215__b877130171014">a</strong> is (0,1].</p>
</div></div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dew_01_0092.html">FAQs</a></div>
</div>
</div>