pyxtea

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: ISC Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const BlockSize = 8

BlockSize is the number of bytes in an XTEA block (for convenience.)

Variables

View Source
var (
	KeyUS = Key{0x03F607A9, 0x036F5A3E, 0x011002B4, 0x04AB00EA}
	KeyJP = Key{0x020A5FD4, 0x01EEBDFF, 0x02B3C6A0, 0x04F6A3E1}
	KeyTH = Key{0x050AD33B, 0x00BAFF09, 0x0452FFDA, 0x02CB4422}
	KeyEU = Key{0x01E986D8, 0x05818479, 0x03D2B0BB, 0x02C9B030}
	KeyID = Key{0x01640DB7, 0x01455A9B, 0x027F1AB7, 0x05918B54}
	KeyKR = Key{0x0485B576, 0x05148E02, 0x05141D96, 0x028FA9D6}
)

XTEA keys used in PangYa.

Functions

func Decipher

func Decipher(key Key, buf []byte) error

Decipher decrypts a buffer of data with XTEA.

func DecipherStream

func DecipherStream(key Key, r io.Reader, w io.Writer) error

DecipherStream decrypts a stream of data with XTEA.

func DecipherStreamTrimNull

func DecipherStreamTrimNull(key Key, r io.Reader, w io.Writer) error

DecipherStreamTrimNull decrypts a stream of data with XTEA and trims nulls at the end.

func DecryptBlock

func DecryptBlock(key Key, buf []byte)

DecryptBlock decrypts a single block of data. Note that XTEA blocks are 8 bytes long.

func Encipher

func Encipher(key Key, buf []byte) error

Encipher encrypts a buffer of data with XTEA.

func EncipherStream

func EncipherStream(key Key, r io.Reader, w io.Writer) error

EncipherStream encrypts a stream of data with XTEA.

func EncipherStreamPadNull

func EncipherStreamPadNull(key Key, r io.Reader, w io.Writer) error

EncipherStreamPadNull encrypts a stream of data with XTEA, inserting null bytes to meet XTEA's block alignment requirements.

func EncryptBlock

func EncryptBlock(key Key, buf []byte)

EncryptBlock encrypts a single block of data. Note that XTEA blocks are 8 bytes long.

Types

type Key

type Key [4]uint32

Key is a type for XTEA keys.

Jump to

Keyboard shortcuts

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