🔐 文字加密解密器
Text Encryptor/Decryptor
什麼是文字加密解密器?
What is the Text Encryptor/Decryptor?
文字加密解密器提供多種加密與解密功能,包含 Base64、URL 編碼、Hex、AES 加密解密,以及 SHA-256 和 MD5 雜湊,協助您有效保護與處理文字資料。
The Text Encryptor/Decryptor offers various encryption and decryption functions, including Base64, URL encoding, Hex, AES encryption/decryption, and SHA-256 and MD5 hashing, helping you effectively protect and process text data.
如何使用?
How to Use?
- 在輸入框中輸入要處理的文字內容。
Enter the text content to be processed in the input field. - 選擇適合的加密或解密方式。
Choose the appropriate encryption or decryption method. - 點擊加密或解密按鈕,結果會顯示在右側輸出區域。
Click the encrypt or decrypt button; the result will appear in the right output area. - 使用複製按鈕可以快速複製結果到剪貼簿。
Use the copy button to quickly copy the result to clipboard.
適用情境
Applicable Scenarios
- 網站開發與 API 整合
Web development and API integration - 資料傳輸與儲存安全
Data transmission and storage security - 密碼與敏感資訊處理
Password and sensitive information processing - 系統日誌與除錯
System logging and debugging
支援的加密方式
Supported Encryption Methods
- Base64:將二進制資料轉換為 ASCII 字元,常用於電子郵件和網頁傳輸。
Converts binary data to ASCII characters; often used in email and web transfer. - URL 編碼:將特殊字元轉換為 URL 安全格式,適用於網址參數傳遞。
Encodes special characters for safe URL transmission. - Hex 編碼:將資料轉換為十六進制表示,常用於程式設計和除錯。
Represents data in hexadecimal; common in programming and debugging. - AES 加密:高級加密標準,提供強大的對稱加密保護。
Advanced Encryption Standard; strong symmetric encryption. - SHA-256:安全雜湊演算法,產生 256 位元的雜湊值(單向,不可解密)。
Secure hashing algorithm producing 256-bit hashes (one-way, cannot be decrypted). - MD5:訊息摘要演算法,常用於檔案完整性驗證(單向,不可解密)。
Message digest algorithm often used for file integrity checks (one-way, cannot be decrypted).
每種加密方式都有其特定的用途和安全性等級,選擇時請根據您的需求和安全要求來決定。
Each encryption method has its specific purpose and security level. Please choose based on your needs and security requirements.
常見問題
Frequently Asked Questions
Base64 是加密嗎?安全性如何?
Base64 是一種編碼(encoding),不是加密(encryption)。它將二進制資料轉成 ASCII 字元,任何人都可以直接解碼,沒有任何保密效果。常見用途是在 HTTP 傳輸圖片(data:image/png;base64,...)、電子郵件附件(MIME)、或 JWT token 的 payload 部分。若需要保密,應改用 AES 等加密演算法。
Base64 is encoding, not encryption — anyone can decode it without a key. It's used for transmitting binary data as text (images in HTML, email attachments, JWT payloads). For actual confidentiality, use AES or similar encryption algorithms instead.
SHA-256 和 MD5 有什麼差別?可以解密嗎?
兩者都是雜湊函式(Hash),均為單向運算,理論上不可逆(無法解密)。差別在於安全性:MD5 輸出 128 位元,已有已知碰撞攻擊,不建議用於安全敏感場景;SHA-256 輸出 256 位元,目前被認為是安全的,廣泛用於憑證簽章、區塊鏈、密碼儲存(搭配 salt)。本工具的雜湊功能僅提供加密按鈕,解密按鈕不適用。
Both are one-way hash functions and cannot be decrypted. MD5 produces 128-bit hashes and has known collision vulnerabilities — avoid for security-critical uses. SHA-256 (256-bit) is currently secure and widely used in TLS certificates, blockchain, and password storage (with salt). The decrypt button is not applicable to hashing.
AES 加密的金鑰長度有要求嗎?
本工具的 AES 使用 PBKDF2(SHA-256、31 萬次迭代)將您輸入的任意長度密碼派生為標準的 256 位元金鑰,因此金鑰長度沒有限制,短密碼也能安全使用。每次加密都會產生隨機 salt 與 IV,並採用 AES-GCM 認證加密(可偵測密文遭竄改)。儘管如此,仍建議使用較長且隨機的密碼,切勿使用簡單密碼如「123456」。
This tool derives a standard 256-bit key from your password of any length using PBKDF2 (SHA-256, 310,000 iterations), so there is no key-length requirement. Each encryption uses a fresh random salt and IV with authenticated AES-GCM (tamper detection). Still, prefer a long, random password — avoid simple ones like "123456".
URL 編碼是什麼?什麼時候需要用?
URL 編碼(Percent-encoding)將 URL 中的特殊字元(如空格、中文、「&」、「=」)轉換為 %XX 格式。當您將參數放入查詢字串(如 ?name=張三)或連結中時,這些字元必須先編碼才能安全傳輸。例如「你好 World」→「%E4%BD%A0%E5%A5%BD%20World」。後端接收後再解碼還原。
URL encoding (percent-encoding) converts special characters (spaces, Chinese, &, =) to %XX format for safe URL transmission. For example, "你好 World" becomes "%E4%BD%A0%E5%A5%BD%20World". The server decodes it back upon receipt. Use this when embedding parameters in query strings or links.
Hex 編碼和 Base64 的差別是什麼?
兩者都是表示二進制資料的方式,差別在於效率:Hex 以每個 byte 兩個十六進制字元表示,體積是原始資料的 2 倍;Base64 以 6 位元為單位,體積約為原始的 1.33 倍,更緊湊。Hex 在除錯、封包分析(Wireshark)和記憶體 Dump 中更直覺;Base64 在網頁和 API 傳輸中更普遍。
Both represent binary data as text. Hex uses 2 characters per byte (2× size); Base64 packs 3 bytes into 4 characters (~1.33× size — more compact). Hex is preferred for debugging, packet analysis (Wireshark), and memory dumps; Base64 is more common in web APIs and data transfer.
加密結果存在伺服器嗎?資料隱私如何?
所有功能(包含 AES 加解密、SHA-256、MD5、Base64、URL、Hex)都完全在您的瀏覽器端以 JavaScript 執行,明文與金鑰不會傳送到伺服器,也不會被記錄或儲存。您甚至可以在載入頁面後離線使用。如有高度機密需求,仍建議在完全離線的環境操作。
Everything — AES encryption/decryption, SHA-256, MD5, Base64, URL, and Hex — runs entirely in your browser via JavaScript. Your plaintext and keys are never sent to the server, logged, or stored; you can even use the tool offline after the page loads. For highly sensitive content, prefer a fully offline environment.
相關工具
Related Tools
為什麼選擇這個工具?
Why Choose This Tool?
它整合多種常用的加密解密方式,介面簡潔易用,支援即時處理,讓您無須安裝額外軟體即可完成各種文字加密解密需求,提升工作效率和資料安全性。
It integrates multiple commonly used encryption and decryption methods with a clean and easy-to-use interface, supporting real-time processing, letting you complete various text encryption and decryption needs without installing additional software, improving work efficiency and data security.