CAST Encryption Tool Icon

CAST Encryption

CAST-128 (CAST5) online encryption and decryption tool, supporting multiple encryption modes such as ECB/CBC/CFB/OFB, flexible padding methods, and output encoding. All operations are performed locally in the browser, ensuring security and efficiency.

Tool Description

CAST Encryption is an online CAST-128 (CAST5) encryption/decryption tool, supporting ECB / CBC / CFB / OFB cipher modes, PKCS#7 / ISO 9797-1 / ANSI X.923 / ISO 10126 / Zero Padding / No Padding padding schemes, and Base64 / Hex / Latin1 output encodings. All operations run locally in the browser — no data is uploaded to any server.

How to Use

  1. Enter Key

    Enter or click the generate button to create a key (CAST-128 uses a fixed 16-byte / 128-bit key)

  2. Configure Algorithm

    Select a cipher mode (ECB / CBC / CFB / OFB). Non-ECB modes require an IV (8 bytes)

  3. Set Parameters

    Choose a padding scheme and output encoding, then paste or type your text in the input area

  4. Run Conversion

    Click "Encrypt" or "Decrypt" to perform the operation

  5. Get Result

    The result will appear on the right. Use Copy or Download to save it, or Swap to exchange input and output

Use Cases

  • OpenPGP Compatibility: CAST5 is a mandatory cipher in OpenPGP (RFC 4880), used for data encryption in PGP/GPG communication
  • Legacy System Integration: Some older systems or embedded devices use CAST-128 encryption; use this tool to verify or generate compatible data
  • Data Protection: Encrypt sensitive data with CAST-128 before storage or transmission — keys never leave your device

Core Advantages

  1. Completely Free

    The tool gives you free daily uses, so everyday light encrypt/decrypt needs are covered at zero cost — no payment required to experience the full feature set.

  2. Local Processing

    All encryption/decryption runs locally in your browser. Plaintext, keys, and ciphertext are never uploaded to any server, maximizing your data privacy.

  3. PGP Compatibility

    Fully supports CAST-128 (CAST5), enabling encryption/decryption compatible verification with the OpenPGP / GnuPG ecosystem.

  4. Easy to Use

    A clean, intuitive interface with no software to install — open the page and use it instantly, including one-click random key generation and result export.

  5. Instant Results

    Processing happens locally and finishes instantly with no server round-trip. Results display on the right side in real time and can be copied or downloaded with one click.

  6. Cross-Platform

    Runs in any modern browser, so Windows, macOS, Linux, and mobile browsers all work without worrying about system compatibility.

Cipher Modes Explained

Different cipher modes determine how data blocks relate to each other, affecting security and applicable scenarios:

Mode Full Name Requires IV Description
ECBElectronic CodebookNoEach block encrypted independently; identical plaintext produces identical ciphertext — not recommended for long texts
CBCCipher Block ChainingYesEach block depends on the previous ciphertext; high security, most commonly used mode
CFBCipher FeedbackYesConverts block cipher to stream cipher; suitable for real-time encryption
OFBOutput FeedbackYesConverts block cipher to stream cipher; errors do not propagate

Padding Schemes Explained

When plaintext length is not a multiple of the block size (8 bytes), padding is required:

  • PKCS#5 / PKCS#7 - Most common; pads with the number of missing bytes (e.g., 3 bytes missing → 0x03 0x03 0x03)
  • ISO 9797-1 - First byte is 0x80, remaining bytes are 0x00
  • ANSI X.923 - Last byte indicates padding length, remaining bytes are 0x00
  • ISO 10126 - Last byte indicates padding length, remaining bytes are random
  • Zero Padding - Pads with 0x00 to block size; no padding if plaintext is already block-aligned
  • No Padding - No padding; plaintext length must be a multiple of block size (8 bytes)

About CAST-128 Algorithm

CAST-128 (also known as CAST5) is a symmetric-key block cipher designed by Carlisle Adams and Stafford Tavares in 1996, defined in RFC 2144. Key characteristics:

  • Block Size - 64 bits (8 bytes)
  • Key Length - 40~128 bits (this tool uses full 128-bit / 16-byte keys)
  • Rounds - 16-round Feistel network structure
  • Design Feature - Uses 8×32-bit large S-boxes, larger than DES's 6×4 S-boxes for enhanced security

FAQ

What is CAST-128 / CAST5?

CAST-128 (also known as CAST5) is a symmetric-key block cipher designed by Carlisle Adams and Stafford Tavares in 1996. It is a mandatory cipher in OpenPGP (RFC 4880) and the default symmetric encryption algorithm in GnuPG 1.x, widely used in PGP encrypted communication.

What's the difference between CAST-128 and AES?

Both are symmetric block ciphers but differ in design: CAST-128 has a 64-bit block size, 40~128-bit key, and 16-round Feistel structure; AES has a 128-bit block size, 128/192/256-bit key, and 10~14-round SPN structure. AES is the modern encryption standard with wider adoption; CAST-128 is primarily used for OpenPGP and legacy system compatibility.

Do encryption and decryption parameters need to match exactly?

Yes, decryption must use the exact same key, cipher mode, padding scheme, and output encoding as encryption. Otherwise, decryption will fail or produce garbled output.

Which cipher mode is most secure?

CBC mode is generally recommended — it is the most commonly used mode with good security and broad compatibility. ECB mode is not recommended for sensitive data as identical plaintext produces identical ciphertext, risking pattern leakage.

Why is the decryption result empty?

Possible reasons: ① Incorrect key or mismatched length (must be 16 bytes); ② Cipher mode or padding scheme does not match what was used for encryption; ③ Wrong output encoding (if Base64 was used for encryption, select Base64 for decryption too); ④ The input is not valid encrypted data.

Is my data uploaded to a server?

No. All encryption/decryption operations run entirely in your browser. Your keys and data never leave your device.

Are Chinese and other non-ASCII characters supported?

Yes. The tool uses UTF-8 encoding to process text and can correctly encrypt and decrypt Chinese, Japanese, Korean, and any other Unicode characters.

What is a CAST encryption tool?

A CAST encryption tool is an online symmetric encryption tool for encrypting and decrypting text with CAST-128 (CAST5). It supports multiple cipher modes and padding schemes, with all operations running locally in the browser — ideal for compatible data handling with the OpenPGP / GnuPG ecosystem.

How fast is the processing? Will it lag?

All processing runs locally in the browser, so it is very fast and most text finishes almost instantly. For very long text, the browser processes it in one pass and generally will not noticeably lag; for extremely large content, splitting it into several runs is recommended.

Does it work on mobile phones? Is mobile supported?

Yes, mobile is supported. The tool runs in a web page, so mobile browsers (iOS Safari, Android Chrome, etc.) can open and use it directly. The layout is responsive, so you can encrypt and decrypt anytime, anywhere.

Is online encryption safer than local software?

This tool uses pure browser-local computation and never uploads data to a server, so its privacy protection is on par with ordinary local software. Compared with third-party software that requires installation and may bundle plugins or collect data, local online computation is lighter and more transparent.

Is this tool free? Do I need to register?

The tool gives you free daily uses, so everyday light encrypt/decrypt needs are covered at zero cost; for higher quotas or more frequent use, a membership unlocks more benefits. Using the basic features requires no registration or login — just open the page and start.

Related Tools

DES Encryption

DES Encryption

Online DES/2DES/3DES encryption and decryption tool, supporting all encryption modes and padding methods. Fully processed locally in the browser for security and efficiency.

AES Encryption

AES Encryption

Online AES encryption and decryption tool, supporting AES-128/192/256, covering all encryption modes and padding methods, secure, efficient, and easy to operate.

3DES Encryption

3DES Encryption

Online 3DES encryption/decryption tool, supporting all encryption modes and padding methods, fully processed locally in the browser to ensure data security.

RC4 Encryption

RC4 Encryption

Online RC4 stream cipher encryption/decryption tool, supports multiple key lengths, one-click encryption and decryption, all operations are completed locally in the browser to ensure data security.

Rabbit Encryption

Rabbit Encryption

Online Rabbit stream cipher encryption/decryption tool, using a high-speed symmetric encryption algorithm, supporting multiple key lengths. All operations are performed locally in the browser to ensure data security.

RC2 Encryption

RC2 Encryption

Online RC2 encryption and decryption tool, supporting ECB/CBC modes, variable key length and effective key bits, all processed locally in the browser to ensure data security.

IDEA Encryption

IDEA Encryption

Online IDEA International Data Encryption Algorithm Tool, supporting multiple encryption modes including ECB/CBC/CFB/OFB/CTR. All operations are performed locally in the browser to ensure data security.

Blowfish Encryption

Blowfish Encryption

Online Blowfish encryption/decryption tool supporting 128/192/256/448-bit variable keys, ECB/CBC/CFB/OFB modes, and multiple padding methods. All operations are performed locally in the browser to ensure data security.

SM4 National Encryption

SM4 National Encryption

Online SM4 National Symmetric Encryption and Decryption Tool, supporting five working modes: ECB/CBC/CFB/OFB/CTR, and multiple padding methods. All operations are performed locally in the browser to ensure data security.

RSA Encryption and Decryption

RSA Encryption and Decryption

Online RSA asymmetric encryption and decryption tool, supporting key pair generation, public key encryption and private key decryption, private key signing and public key verification. All operations are performed locally in the browser to ensure data security.

MD5 Encryption

MD5 Encryption

Online MD5 hash encryption tool, supporting 16-bit/32-bit output, case switching, and file MD5 verification. All operations are completed locally in the browser, ensuring security and efficiency.

MD2 Encryption

MD2 Encryption

MD2 Encryption Tool: Generate 32-bit MD2 hash values online, supporting uppercase/lowercase output and file verification.

SHA-1 Encryption

SHA-1 Encryption

Online SHA-1 hash calculation tool for efficient text encryption and file integrity verification.

SHA-256 Encryption

SHA-256 Encryption

Online SHA-256 hash calculation tool for quick text encryption and file integrity verification.

SHA-384 Encryption

SHA-384 Encryption

Online SHA-384 hash calculation tool for fast text encryption and file integrity verification.

SHA-512 Encryption

SHA-512 Encryption

Online SHA-512 hash calculation tool, supporting text encryption and file integrity verification, quickly generating secure hash values.

SM3 National Encryption

SM3 National Encryption

Online SM3 National Hash Encryption Tool, supports text hash calculation and file verification, outputs a 256-bit hash value, compliant with GM/T 0004-2012 national standard.

Base64 Encode/Decode

Base64 Encode/Decode

Online Base64 encode/decode tool, supporting text Base64 encoding and decoding, all done locally in the browser, safe and efficient.

URL Encode/Decode

URL Encode/Decode

Online URL encoding and decoding tool, supports intelligent encoding and decoding of URL parameters, automatically identifies URL structure, processes only the parameter part, completes entirely in the browser locally, safe and efficient.

UTF-8 Encode/Decode

UTF-8 Encode/Decode

Online UTF-8 encoding/decoding tool, supporting conversion between text and UTF-8 hexadecimal bytes. All processing is done locally in the browser, ensuring data security.

General Membership

Enjoy membership benefits

Exclusive Benefits

  • Unlimited use of 290+ web tools
  • Cross-platform benefits
  • New tools included
  • Free updates

Basic Benefits

  • Larger file size
  • More files
  • Full features on web
  • Full features on desktop

Monthly Member Plan

¥ 8.9
Original: ¥19.9
Valid for 30 days

Quarterly Member Plan

¥ 19.9
Original: ¥59.9
As low as 6.6 yuan/month
Hot

Yearly Member Plan

¥ 69.9
Original: ¥229.9
As low as 5.8 yuan/month
Pay: ¥ 9

Please scan with WeChat to pay

Payment indicates your agreement to the relevant terms

*No 7-day unconditional refund