Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeyPair ¶
GetKeyPair returns a pair of client encryption keys for the provided client version. If no key pair exists for the provided version, an empty key pair and an "unsupported version" error are returned. The empty key pair should not be used for encryption purposes.
Types ¶
type CipherName ¶
type CipherName string
CipherName captures the name of a supported password encryption cipher.
const ( None CipherName = "" Bcrypt CipherName = "bcrypt" )
Supported password ciphers.
func (CipherName) Valid ¶
func (name CipherName) Valid() bool
Valid indicates whether the cipher name is valid.
type GameCryptoService ¶
type GameCryptoService struct {
// contains filtered or unexported fields
}
func NewGameCryptoService ¶
func NewGameCryptoService(seed avatar.Seed) (*GameCryptoService, error)
func (GameCryptoService) GetSeed ¶
func (s GameCryptoService) GetSeed() avatar.Seed
type LoginCryptoService ¶
type LoginCryptoService struct {
// contains filtered or unexported fields
}
LoginCryptoService is an avatar.CryptoService compatible with modern "classic" (2D) capable of decrypting data during the login process. LoginCryptoService cannot encrypt data.
LoginCryptoService implements a rolling cipher on both ends. Decrypting data modifies the internal state of the service and affects subsequent decryption operations.
func NewLoginCryptoService ¶
func NewLoginCryptoService( seed avatar.Seed, version *avatar.Version, ) (*LoginCryptoService, error)
NewLoginCryptoService creates a new LoginCryptoService.
func (*LoginCryptoService) Decrypt ¶
func (cs *LoginCryptoService) Decrypt(src []byte, dst []byte) error
Decrypt src into dst. Bytes in dst are overridden as decryption occurs.
If len(src) > len(dst), up to len(dst) bytes are decrypted and an error is returned.
func (*LoginCryptoService) Encrypt ¶
func (cs *LoginCryptoService) Encrypt(src []byte, dst []byte) error
Encrypt is an invalid operation for LoginCryptoService and always panics.
func (LoginCryptoService) GetSeed ¶
func (cs LoginCryptoService) GetSeed() avatar.Seed
type NilCryptoService ¶
type NilCryptoService struct{}
NilCryptoService is an avatar.CryptoService that does not modify input when encrypting and decrypting data.
func (NilCryptoService) Decrypt ¶
func (c NilCryptoService) Decrypt(src []byte, dst []byte) error
Decrypt src into dst. The bytes copies to dst are equal to those in src.
func (NilCryptoService) Encrypt ¶
func (c NilCryptoService) Encrypt(src []byte, dst []byte) error
Encrypt src into dst. The bytes copies to dst are equal to those in src.
func (NilCryptoService) GetSeed ¶
func (c NilCryptoService) GetSeed() avatar.Seed