crypto: Index | Files

package cast5

import ""

Package cast5 implements CAST5, as defined in RFC 2144.

CAST5 is a legacy cipher and its short block size makes it vulnerable to birthday bound attacks (see It should only be used where compatibility with legacy systems, not security, is the goal.

Deprecated: any new system should use AES (from crypto/aes, if necessary in an AEAD mode like crypto/cipher.NewGCM) or XChaCha20-Poly1305 (from


Package Files



const BlockSize = 8
const KeySize = 16

type Cipher Uses

type Cipher struct {
    // contains filtered or unexported fields

func NewCipher Uses

func NewCipher(key []byte) (c *Cipher, err error)

func (*Cipher) BlockSize Uses

func (c *Cipher) BlockSize() int

func (*Cipher) Decrypt Uses

func (c *Cipher) Decrypt(dst, src []byte)

func (*Cipher) Encrypt Uses

func (c *Cipher) Encrypt(dst, src []byte)

Package cast5 imports 1 packages (graph) and is imported by 73 packages. Updated 2020-12-22. Refresh now. Tools for package owners.