Files
doc-exports/docs/kms/umn/dew_01_0022.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

29 lines
7.3 KiB
HTML

<a name="dew_01_0022"></a><a name="dew_01_0022"></a>
<h1 class="topictitle1">Using the Online Tool to Encrypt and Decrypt Small-Size Data</h1>
<div id="body1511507276995"><p id="dew_01_0022__p430347211597">This section describes how to use the online tool to encrypt or decrypt small-size data (4 KB or smaller) on the KMS console.</p>
<div class="section" id="dew_01_0022__section2108995215120"><h4 class="sectiontitle">Prerequisites</h4><p id="dew_01_0022__p169881058132818">The custom key is in <span class="parmname" id="dew_01_0022__parmname124131141161112"><b>Enabled</b></span> status.</p>
</div>
<div class="section" id="dew_01_0022__section1895018118274"><h4 class="sectiontitle">Constraints</h4><ul id="dew_01_0022__ul1719311159272"><li id="dew_01_0022__li1419310151277">Default keys cannot be used to encrypt or decrypt such data with the tool.</li><li id="dew_01_0022__li158581831131112">Asymmetric keys cannot be used to encrypt or decrypt such data with the tool.</li><li id="dew_01_0022__li1719321514274">You can call an API to use a default key to encrypt or decrypt small volumes of data. For details, see the <em id="dew_01_0022__i1334716328148">Key Management Service API Reference</em>.</li><li id="dew_01_0022__li9672143820328">Use the current CMK to encrypt the data.</li><li id="dew_01_0022__li1294176103319">Exercise caution when you delete a CMK. The online tool cannot decrypt data if the CMK used for encryption has been deleted.</li><li id="dew_01_0022__li579415973318">After an API is called to encrypt data, the online tool cannot be used to decrypt the data.</li></ul>
</div>
<div class="section" id="dew_01_0022__section45724709151226"><h4 class="sectiontitle">Encrypting Data</h4><ol id="dew_01_0022__ol17677259151342"><li id="dew_01_0022__li20878132444910"><span>Log in to the management console.</span></li><li id="dew_01_0022__li11878172474919"><span>Click <span><img id="dew_01_0022__dew_01_0178_image10325154918393" src="en-us_image_0000001284811084.png"></span> in the upper left corner of the management console and select a region or project.</span></li><li id="dew_01_0022__li1279512297175"><span>Click <span><img id="dew_01_0022__image1124575085517" src="en-us_image_0000002511598247.png"></span> on the left and choose <span class="menucascade" id="dew_01_0022__menucascade42460501558"><b><span class="uicontrol" id="dew_01_0022__uicontrol7245175010555">Security</span></b> &gt; <b><span class="uicontrol" id="dew_01_0022__uicontrol02461850205516">Key Management Service</span></b></span>.</span></li><li id="dew_01_0022__li49600184597"><span>Click the name of the target custom key to access the key details page. Click the <strong id="dew_01_0022__b145035013559">Tool</strong> tab.</span></li><li id="dew_01_0022__li8513572061"><span>Click <strong id="dew_01_0022__b177715251418">Encrypt</strong>. In the text box on the left, enter the data to be encrypted, as shown in <a href="#dew_01_0022__fig61927028183617">Figure 1</a>.</span><p><div class="fignone" id="dew_01_0022__fig61927028183617"><a name="dew_01_0022__fig61927028183617"></a><a name="fig61927028183617"></a><span class="figcap"><b>Figure 1 </b>Encrypting data</span><br><span><img id="dew_01_0022__image2707364481" src="en-us_image_0000001629601212.png"></span></div>
</p></li><li id="dew_01_0022__li145581622484"><span>Click <strong id="dew_01_0022__b10106172520422">Execute</strong>. Ciphertext of the data is displayed in the text box on the right.</span><p><div class="note" id="dew_01_0022__note1652557269"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dew_01_0022__ul13212113916814"><li id="dew_01_0022__li8211914111510">Use the current CMK to encrypt the data.</li><li id="dew_01_0022__li4212153919814">To clear your input, click <strong id="dew_01_0022__b429844654214">Clear</strong>.</li><li id="dew_01_0022__li152125391984">To copy the encrypted data, click <strong id="dew_01_0022__b02094587429">Copy to Clipboard</strong>. You can then paste and save it to a local file.</li></ul>
</div></div>
</p></li></ol>
</div>
<div class="section" id="dew_01_0022__section251382416917"><h4 class="sectiontitle">Decrypting Data</h4><ol id="dew_01_0022__ol2839154719318"><li id="dew_01_0022__li5490143683618"><span>Log in to the management console.</span></li><li id="dew_01_0022__li1383954718318"><span>Click <span><img id="dew_01_0022__dew_01_0178_image10325154918393_1" src="en-us_image_0000001284811084.png"></span> in the upper left corner of the management console and select a region or project.</span></li><li id="dew_01_0022__li9748814203513"><span>Click <span><img id="dew_01_0022__image5564195211553" src="en-us_image_0000002511605033.png"></span> on the left and choose <span class="menucascade" id="dew_01_0022__menucascade956535216555"><b><span class="uicontrol" id="dew_01_0022__uicontrol1656412526559">Security</span></b> &gt; <b><span class="uicontrol" id="dew_01_0022__uicontrol5565155213551">Key Management Service</span></b></span>.</span></li></ol><ol start="4" id="dew_01_0022__ol12988161919918"><li id="dew_01_0022__li1486413121014"><span>You can click any non-default key in <strong id="dew_01_0022__b842352706112914">Enabled</strong> status to go to the encryption and decryption page of the online tool.</span></li><li id="dew_01_0022__li11865163131014"><span>Click <strong id="dew_01_0022__b12255116194310">Decrypt</strong> and enter the data to be decrypted in the text box, as shown in <a href="#dew_01_0022__fig1586514341014">Figure 2</a>.</span><p><div class="note" id="dew_01_0022__note3864113161017"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dew_01_0022__ul1812317431410"><li id="dew_01_0022__li312313481420">The tool will identify the original encryption CMK and use it to decrypt the data.</li><li id="dew_01_0022__li41234411143">If the key has been deleted, the decryption will fail.</li></ul>
</div></div>
<div class="fignone" id="dew_01_0022__fig1586514341014"><a name="dew_01_0022__fig1586514341014"></a><a name="fig1586514341014"></a><span class="figcap"><b>Figure 2 </b>Decrypting data</span><br><span><img id="dew_01_0022__image694415194517" src="en-us_image_0000001629122164.png"></span></div>
</p></li><li id="dew_01_0022__li78650312108"><span>Click <strong id="dew_01_0022__b842352706163142">Execute</strong>. Plaintext of the data is displayed in the text box on the right.</span><p><div class="note" id="dew_01_0022__note15120629191411"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dew_01_0022__ul135993613337"><li id="dew_01_0022__li11600065339">You can click <strong id="dew_01_0022__b842352706164331">Copy to Clipboard</strong> to copy the plaintext and save it in a local file.</li><li id="dew_01_0022__li1628081119238">Enter the plaintext on the console, the text will be encoded to Base64 format before encryption.<p id="dew_01_0022__p19341104193711"><a name="dew_01_0022__li1628081119238"></a><a name="li1628081119238"></a>The decryption result returned via API will be in Base64 format. Perform Base64 decoding to obtain the plaintext entered on the console.</p>
</li></ul>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dew_01_0177.html">Key Management Service</a></div>
</div>
</div>