crypt

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AESInitType enum.AESInitType = enum.Default

	CycleAESKeys = [20][32]byte{
		0:  {0x29, 0x00, 0x00, 0x00, 0xE1, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00},
		1:  {0xB3, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x5D, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00},
		2:  {0x88, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0xDB, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00},
		3:  {0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00},
		4:  {0xF6, 0x00, 0x00, 0x00, 0xE1, 0x00, 0x00, 0x00, 0xB0, 0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xB2, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00},
		5:  {0xBF, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00},
		6:  {0x02, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0xCF, 0x00, 0x00, 0x00},
		7:  {0x48, 0x00, 0x00, 0x00, 0xE6, 0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00},
		8:  {0x18, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00},
		9:  {0x5B, 0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xA7, 0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00},
		10: {0x76, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xB1, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00},
		11: {0x10, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x8A, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00},
		12: {0x5E, 0x00, 0x00, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x9F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00},
		13: {0xDA, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00},
		14: {0x0F, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xF3, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00},
		15: {0x87, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0xDB, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00},
		16: {0xCA, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x00, 0x00, 0xF6, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00},
		17: {0x5E, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0x9D, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00},
		18: {0xCD, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00},
		19: {0x9F, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0xD3, 0x00, 0x00, 0x00},
	}
)

Functions

func AES_Init

func AES_Init(info *AES_ALG_INFO, pdwKey []byte)

void __cdecl CAESCipher::AES_DecInit(CAESCipher::AES_ALG_INFO *AlgInfo, unsigned int *pdwKey) void __cdecl CAESCipher::AES_EncInit(CAESCipher::AES_ALG_INFO *AlgInfo, unsigned int *pdwKey)

func OFB_Update

func OFB_Update(info *AES_ALG_INFO, buf []byte)

char __cdecl CAESCipher::OFB_DecUpdate(CAESCipher::AES_ALG_INFO *AlgInfo,char *CipherTxt,unsigned int CipherTxtLen,char *PlainTxt,unsigned int *PlainTxtLen) char __cdecl CAESCipher::OFB_EncUpdate(CAESCipher::AES_ALG_INFO *AlgInfo,char *PlainTxt,unsigned int PlainTxtLen,char *CipherTxt,unsigned int *CipherTxtLen)

func RIJNDAEL_KeySchedule

func RIJNDAEL_KeySchedule(userKey []byte, info *AES_ALG_INFO)

void __cdecl CAESCipher::RIJNDAEL_KeySchedule(unsigned int *UserKey, unsigned int *e_key)

func ROL1

func ROL1(val byte, num int) byte

func ROL4

func ROL4(value uint32, shift uint32) uint32

func ROR1

func ROR1(val byte, num int) byte

Types

type AES_ALG_INFO

type AES_ALG_INFO struct {
	ChainVar []byte       // 16 size IV
	Block    cipher.Block // Use Block to generate RoundKey
}

type CAESCipher

type CAESCipher struct{}

func (*CAESCipher) Decrypt

func (static *CAESCipher) Decrypt(userKey [32]byte, buf []byte, pdwkey []byte)

void __cdecl CAESCipher::Decrypt(unsigned __int8 *pDest, unsigned __int8 *pSrc, int nLen, unsigned int *pdwKey)

func (*CAESCipher) Encrypt

func (static *CAESCipher) Encrypt(userKey [32]byte, buf []byte, pdwkey []byte)

void __cdecl CAESCipher::Encrypt(unsigned __int8 *pDest, unsigned __int8 *pSrc, int nLen, unsigned int *pdwKey)

type CIGCipher

type CIGCipher struct{}

func (*CIGCipher) InnoHash

func (static *CIGCipher) InnoHash(pdwKey []byte)

unsigned int __cdecl CIGCipher::innoHash(unsigned __int8 *pSrc, int nLen, unsigned int *pdwKey)

func (*CIGCipher) Shuffle added in v1.0.8

func (static *CIGCipher) Shuffle(pdwKey []byte, inputKey byte)

type CIOBufferManipulator

type CIOBufferManipulator struct{}

func (*CIOBufferManipulator) De

func (static *CIOBufferManipulator) De(buf []byte)

func (*CIOBufferManipulator) En

func (static *CIOBufferManipulator) En(buf []byte)

Jump to

Keyboard shortcuts

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