package tea
import "golang.org/x/crypto/tea"
Package tea implements the TEA algorithm, as defined in Needham and Wheeler's 1994 technical report, “TEA, a Tiny Encryption Algorithm”. See http://www.cix.co.uk/~klockstone/tea.pdf for details.
TEA is a legacy cipher and its short block size makes it vulnerable to birthday bound attacks (see https://sweet32.info). 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 golang.org/x/crypto/chacha20poly1305).
Index ¶
- Constants
- func NewCipher(key []byte) (cipher.Block, error)
- func NewCipherWithRounds(key []byte, rounds int) (cipher.Block, error)
Constants ¶
const ( // BlockSize is the size of a TEA block, in bytes. BlockSize = 8 // KeySize is the size of a TEA key, in bytes. KeySize = 16 )
Functions ¶
func NewCipher ¶
NewCipher returns an instance of the TEA cipher with the standard number of rounds. The key argument must be 16 bytes long.
func NewCipherWithRounds ¶
NewCipherWithRounds returns an instance of the TEA cipher with a given number of rounds, which must be even. The key argument must be 16 bytes long.
Source Files ¶
cipher.go
- Version
- v0.34.0 (latest)
- Published
- Feb 22, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 9 hours ago –
Tools for package owners.