{"id":13453,"date":"2026-06-11T12:00:20","date_gmt":"2026-06-11T04:00:20","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=13453"},"modified":"2026-06-11T13:20:11","modified_gmt":"2026-06-11T05:20:11","slug":"%e5%8a%a0%e5%af%86%ef%bc%8c%e5%af%86%e9%92%a5%ef%bc%8c%e8%af%81%e4%b9%a6%e7%9b%b8%e5%85%b3%e5%ad%a6%e4%b9%a0%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/13453","title":{"rendered":"Summary of Learning on Encryption, Keys, and Certificates"},"content":{"rendered":"<p>Symmetric encryption AES SM4, asymmetric encryption RSA SM2, hash digest SHA SM3: How are the strings generated by these algorithms turned into certificates?<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2a803ea3b67\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2a803ea3b67\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E5%8A%A0%E5%AF%86\" >Encryption<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E5%AF%86%E9%92%A5\" >Key<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AE%97%E6%B3%95\" >Algorithm<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AE%97%E6%B3%95%E7%B1%BB%E5%9E%8B\" >Algorithm types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AE%97%E6%B3%95%E9%95%BF%E5%BA%A6\" >Algorithm length<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AE%97%E6%B3%95%E6%A8%A1%E5%BC%8F\" >Algorithm Patterns<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AE%97%E6%B3%95%E5%AE%9E%E7%8E%B0\" >Algorithm implementation<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E8%AF%81%E4%B9%A6\" >Certificate<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#CA%EF%BC%88Certification_Authority%EF%BC%89%E6%9C%BA%E6%9E%84\" >Certification Authority (CA)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%AD%BE%E8%AF%81%E7%94%B3%E8%AF%B7CSR%EF%BC%88Certificate_signing_request%EF%BC%89\" >Visa application CSR (Certificate Signing Request)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E7%94%B3%E8%AF%B7%E5%88%B0%E7%9A%84%E8%AF%81%E4%B9%A6\" >Certificate obtained<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E5%8F%8C%E5%90%91%E8%AF%81%E4%B9%A6\" >Two-way certificate<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E5%85%B6%E5%AE%83\" >Others<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E5%AF%86%E9%92%A5%E7%9A%84%E4%BF%9D%E6%8A%A4\" >Key protection<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.gbase8.cn\/en\/13453\/#%E6%80%BB%E7%BB%93\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8A%A0%E5%AF%86\"><\/span>Encryption<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%86%E9%92%A5\"><\/span>Key<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A string, or more precisely a binary string. For human readability, it's usually encoded with BASE64.<\/p>\n\n\n\n<p>Encryption algorithms use this string to encrypt data, ensuring that the original content (plaintext) is not leaked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%97%E6%B3%95\"><\/span>Algorithm<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%97%E6%B3%95%E7%B1%BB%E5%9E%8B\"><\/span>Algorithm types<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>If the same key is used for encryption and decryption, it is a symmetric encryption algorithm. For example, AES, SM4, etc. <\/p>\n\n\n\n<p>If encryption and decryption use different keys, then it is an asymmetric encryption algorithm, such as RSA, SM2, etc. The keys are divided into private keys and public keys, where the public key can be disclosed and obtained by any user. The private key must be strictly kept confidential. The public key can be calculated from the private key, but the private key cannot be calculated from the public key.<\/p>\n\n\n\n<p>If this encryption algorithm is one-way, it's a hash digest algorithm, such as SHA, SM3, etc. Any change to the original content will lead to a change in the digest result. It's impossible to calculate the original data from the digest.<\/p>\n\n\n\n<p><strong>Algorithm Comparison Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Algorithm categories<\/th><th>Core definition<\/th><th>Mainstream Representative Algorithms<\/th><th>Core usage scenarios<\/th><th>Core advantages<\/th><th>Core disadvantage<\/th><th>An inviolable red line of security<\/th><\/tr><\/thead><tbody><tr><td><strong>Symmetric encryption algorithm<\/strong><\/td><td>Encryption, decryption use<strong>The same key<\/strong>The core is block cipher \/ stream cipher, with a fixed key length, an open algorithm, and security dependent on key secrecy<\/td><td>[International Standards] AES-128\/192\/256, ChaCha20 [Domestic Standards] SM4-128 [Deprecated] DES\/3DES<\/td><td>1. Bulk data \/ file \/ disk encryption\n2. Database sensitive field encryption\n3. TLS\/SSH\/VPN session data encryption\n4. High-speed internal network data transmission encryption<\/td><td>1. Extremely fast encryption\/decryption speeds, full performance.\n2. Low resource utilization, suitable for embedded\/low-power devices.\n3. Comprehensive hardware acceleration support (AES-NI \/ domestic crypto chips).\n4. Simple implementation, excellent compatibility.<\/td><td>1. Key distribution is difficult and cannot be securely transmitted over public networks.\n2. Lacks identity authentication capabilities, unable to prove data origin.\n3. Once a key is leaked, encryption becomes completely ineffective.\n4. Does not support non-repudiation, unable to prevent denial.<\/td><td>1. ECB mode is prohibited in the production environment.\n2. Hardcoding keys and committing keys to code repositories are prohibited.\n3. Weak\/fixed keys are prohibited; keys must be rotated regularly.\n4. Passwords must not be used as direct replacements for standard keys.<\/td><\/tr><tr><td><strong>Asymmetric encryption algorithm (public-key cryptography)<\/strong><\/td><td>Encryption, decryption use<strong>A pair of highly correlated keys<\/strong>Public keys can be distributed publicly, private keys must be kept absolutely confidential; it is impossible to derive the private key from the public key.<\/td><td>[International Mainstream] RSA, ECC (secp256r1\/secp384r1), Ed25519 [Chinese Cryptographic Standard] SM2<\/td><td>1. Identity authentication, digital signature \/ verification\n2. Key negotiation (e.g., symmetric key transmission during TLS handshake)\n3. Digital certificate systems, HTTPS\/SSL communication\n4. Mutual authentication, code signing, blockchain, electronic seals<\/td><td>1. Completely solves the difficult problem of key distribution over public networks.\n2. Supports identity authentication and non-repudiation, preventing denial.\n3. Public keys can be fully disclosed and do not require confidential transmission.\n4. Private keys are held only by the owner, and identity is traceable.<\/td><td>1. Encryption and decryption speed is extremely slow, with performance far below that of symmetric algorithms.\n2. High resource utilization, not suitable for large-volume data encryption.\n3. Longer key lengths, resulting in greater storage\/transmission overhead.\n4. Complex implementation, with extremely high requirements for parameter compliance.<\/td><td>1. Private key = lifeline; absolutely forbidden to leak or store in plain text.\n2. Forbidden to use weak key lengths (RSA &lt; 2048 bits, SM2 &lt; 256 bits).\n3. Raw public keys must be authenticated through a CA certificate system to prevent man-in-the-middle attacks.\n4. Forbidden to encrypt large amounts of data with public keys; only use for small data \/ key transfer.<\/td><\/tr><tr><td><strong>Hashing Algorithm<\/strong><\/td><td>\u5c06<strong>Raw data of arbitrary length<\/strong>unidirectional mapping<strong>Fixed-length unique hash value<\/strong>No key, irreversible, original data cannot be inferred from the hash value<\/td><td>[International Mainstream] SHA-256\/SHA-384\/SHA-512 (SHA-2 Series), SHA-3 Series [Chinese National Standard] SM3 [Cracked and Obsolete] MD5, SHA-1<\/td><td>1. Data integrity verification, file tamper-proofing verification\n2. Digital signature pairing (hash first, then sign)\n3. Salted password hash storage (server-side prohibits plaintext password storage)\n4. Certificate fingerprint, interface anti-replay, blockchain block hash<\/td><td>1. One-way and irreversible; the original text cannot be inferred from the hash value.\n2. Fixed-length output; regardless of the original text length, the result length is unified.\n3. Fast calculation speed and extremely low resource utilization.\n4. Accurately verifies whether data has been tampered with, even with a 1-byte change.<\/td><td>1. No encryption capabilities, can only perform integrity checks.\n2. Cannot solve identity authentication problems, and has no trust endorsement when used alone.\n3. Weak algorithms have the risk of hash collisions and can be forged.\n4. Cannot be directly used for data encryption and transmission.<\/td><td>1. MD5, SHA-1, and other broken weak algorithms are absolutely forbidden in production environments.\n2. Passwords must be salted and hashed for storage; direct storage of raw hash values is prohibited.\n3. Hash values must not be used directly as encryption keys.\n4. Tamper-proof scenarios must be combined with signature\/certificate systems; hashing alone cannot prevent forgery.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%97%E6%B3%95%E9%95%BF%E5%BA%A6\"><\/span>Algorithm length<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The number after the algorithm, such as AES-128, indicates a 128-bit (16-byte) key, while AES-256 uses a 32-byte key. SM4, on the other hand, is fixed at 128 bits (16-byte length).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%97%E6%B3%95%E6%A8%A1%E5%BC%8F\"><\/span>Algorithm Patterns<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The same algorithm may have different modes, such as AES-128-CTR, AES-128-CBC, AES-256-GCM, AES-192-CCM; SM4-128-CBC, SM4-128-CTR.<\/p>\n\n\n\n<p><strong>Comparison of Common Patterns<\/strong><\/p>\n\n\n\n<p>Table<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Mode<\/th><th class=\"has-text-align-left\" data-align=\"left\">Full name<\/th><th class=\"has-text-align-left\" data-align=\"left\">Features<\/th><th class=\"has-text-align-left\" data-align=\"left\">Typical scenario<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>European Central Bank<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Electronic Password Book<\/td><td class=\"has-text-align-left\" data-align=\"left\">The simplest, but least secure (same plaintext = same ciphertext)<\/td><td class=\"has-text-align-left\" data-align=\"left\">Almost eliminated<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>CBC<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Password group link<\/td><td class=\"has-text-align-left\" data-align=\"left\">Padding, Serial, Legacy TLS<\/td><td class=\"has-text-align-left\" data-align=\"left\">Legacy systems, compatibility scenarios<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>Click-through rate<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Counter<\/td><td class=\"has-text-align-left\" data-align=\"left\">Parallel, non-padded, stream cipher<\/td><td class=\"has-text-align-left\" data-align=\"left\">VPN, Disk, High Performance<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>GCM<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Galois counter<\/td><td class=\"has-text-align-left\" data-align=\"left\"><strong>CTR + Certification<\/strong>(AEAD), most secure<\/td><td class=\"has-text-align-left\" data-align=\"left\">HTTPS\/TLS 1.3, SSH, IPsec<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>CCM<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Counter - Password Blockchain<\/td><td class=\"has-text-align-left\" data-align=\"left\">With certification, suitable for low power consumption<\/td><td class=\"has-text-align-left\" data-align=\"left\">Bluetooth, IoT, 802.15.4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%97%E6%B3%95%E5%AE%9E%E7%8E%B0\"><\/span>Algorithm implementation<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Some algorithms place their provider or implementer at the end, such as<code>aes128-ctr@openssh.com<\/code>This indicates that the AES-128 algorithm in CTR mode is implemented by OpenSSH.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AF%81%E4%B9%A6\"><\/span>Certificate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Who does the key belong to? Is it valid? Is it forged?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CA%EF%BC%88Certification_Authority%EF%BC%89%E6%9C%BA%E6%9E%84\"><\/span>Certification Authority (CA)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>For key security, keys need to be packaged and certified to prove their ownership, validity, and include new strings from an issuing authority, which is a certificate. This issuing authority is the CA.<\/p>\n\n\n\n<p>If authentication is private, such as services within a local area network, you can build your own CA, distribute certificates, and enforce recognition.<\/p>\n\n\n\n<p>If the certificate is publicly available\u2014such as for public internet services\u2014it must be issued by a widely recognized CA, such as DigiCert or CFCA.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AD%BE%E8%AF%81%E7%94%B3%E8%AF%B7CSR%EF%BC%88Certificate_signing_request%EF%BC%89\"><\/span>Visa application CSR (Certificate Signing Request)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To obtain a CA-signed certificate, you must package the application information into a CSR and submit it to the CA. Since this information is in plain text, it can theoretically be submitted to multiple CAs for review.<\/p>\n\n\n\n<p>CSR files contain:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Yours<strong>Public key<\/strong><\/li>\n\n\n\n<li>Subject Information (Domain Name \/ Organization \/ City \/ Country, etc.)<\/li>\n\n\n\n<li>When generating a block of data to be signed, the following is used:<strong>Local private key<\/strong>Sign your own CSR to prove the requester holds the corresponding private key.<\/li>\n<\/ul>\n\n\n\n<p>A piece of data within it can be decrypted using the public key in the CSR, thereby proving that the CSR initiator indeed possesses the private key corresponding to this public key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%94%B3%E8%AF%B7%E5%88%B0%E7%9A%84%E8%AF%81%E4%B9%A6\"><\/span>Certificate obtained<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Its content, in addition to the applicant's information, includes important additional content from the CA:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Certificate Number: Unique<\/li>\n\n\n\n<li>Issuer Information: Country, Province, City, Organization, Common Name (CA Name), representing \u201cWho issued this certificate\u201d<\/li>\n\n\n\n<li>Signature Algorithm: Algorithm used by the CA when issuing, for example <code>sha256WithRSAEncryption<\/code>\u3001<code>sm3WithSM2Encryption<\/code><\/li>\n\n\n\n<li>Expiration date:<\/li>\n<\/ul>\n\n\n\n<p>The CA will encrypt the certificate content above with its private key (digital signature). The user verifies the signature with the public key issued by the issuing structure, proving that the certificate was issued by a legitimate CA institution, that the content is authentic, and that it has not expired.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%8C%E5%90%91%E8%AF%81%E4%B9%A6\"><\/span>Two-way certificate<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>It's the client and server, each sending their own certificate to authenticate with the other, and then starting official communication after confirming identities.<\/p>\n\n\n\n<p>The certificates from both parties can be issued by different CA authorities, especially for internet services. However, in a local area network environment, to simplify things, most organizations build their own CA, with most certificates issued by the same CA.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%85%B6%E5%AE%83\"><\/span>Others<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%86%E9%92%A5%E7%9A%84%E4%BF%9D%E6%8A%A4\"><\/span>Key protection<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When generating asymmetric keys, primarily the private key, it can be protected with AES, and the password needs to be entered the next time the private key is used. This prevents the plaintext private key from being leaked.<\/p>\n\n\n\n<p>But if the user is a backend service, such as a database or HTTPS service, it's impossible for the backend to manually enter a password when the user accesses it to use the private key for authentication. In this case, you can:<\/p>\n\n\n\n<p>1. Remove this protection password. At this point, the private key is in plaintext. Protect the plaintext key file through access control.<\/p>\n\n\n\n<p>2. Modify the backend service to import the password into the service. When decrypting the private key, provide the password for normal use. Of course, this password then becomes an object to be protected. If security still doesn't allow this, then this password should not be saved locally but rather stored in a Key Management System (KMS). After this password is encrypted by KMS, it is saved locally. When using it, such as during service startup, send the encrypted password to KMS for decryption first, obtain the plaintext password, and store it only in memory for subsequent use of the private key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%80%BB%E7%BB%93\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Asymmetric encryption is mainly used for identity authentication, and the key length is generally longer, 2048 or even 4096. For the secure and trustworthy public key information, certificates and corresponding recognized issuing authorities have emerged.<\/p>\n\n\n\n<p>Symmetric encryption is mainly used for secure data transmission, and performance requirements cannot be significantly reduced. Key lengths of 128, 192, or 256 bits are generally sufficient. This key is dynamically negotiated by both parties when they connect. During this process, encrypting it with the other party's public key before transmission ensures security during the negotiation.<\/p>\n\n\n\n<p>A hash is used to verify that a piece of text has not been tampered with.<\/p>","protected":false},"excerpt":{"rendered":"<p>Symmetric encryption AES SM4, asymmetric encryption RSA SM2, hash digest SHA SM3: How are the strings generated by these algorithms turned into certificates?<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[72,76],"class_list":["post-13453","post","type-post","status-publish","format-standard","hentry","category-1","tag-linux","tag-76"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=13453"}],"version-history":[{"count":19,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13453\/revisions"}],"predecessor-version":[{"id":13474,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13453\/revisions\/13474"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=13453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=13453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=13453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}