tea

package
v0.0.0-...-08fe5ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext []byte, key []byte, round int) ([]byte, error)

Decrypt 解密 静态方法

func Encrypt

func Encrypt(plaintext []byte, key []byte, round int) ([]byte, error)

Encrypt 加密 静态方法 不做填充处理,必须自己保证 plaintext 可以 每组 8 字节等分

Types

type Tea

type Tea struct {
	Round   int    // 加轮数,必须为偶数
	Padding string // 填充算法 需要明文 8 字节一组
}

func GetInstance

func GetInstance(round int, padding string) *Tea

func (*Tea) Decrypt

func (t *Tea) Decrypt(ciphertext []byte, key []byte) ([]byte, error)

Decrypt 解密

func (*Tea) Encrypt

func (t *Tea) Encrypt(plaintext []byte, key []byte) ([]byte, error)

Encrypt 加密

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL