encryption

package
v0.0.0-...-1a2867a Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

* Archon PSO Server * Copyright (C) 2014 Andrew Rodman * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * --------------------------------------------------------------------- * * Blowfish implementation adapted to work with PSOBB's protocol.

Index

Constants

View Source
const BlockSize = 8

The Blowfish block size in bytes.

View Source
const PCBlockSize = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher struct {
	// contains filtered or unexported fields
}

A Cipher is an instance of Blowfish encryption using a particular key.

type KeySizeError

type KeySizeError int

func (KeySizeError) Error

func (k KeySizeError) Error() string

type PCCrypt

type PCCrypt struct {
	// contains filtered or unexported fields
}

type PCKeySizeError

type PCKeySizeError int

func (PCKeySizeError) Error

func (k PCKeySizeError) Error() string

type PSOCrypt

type PSOCrypt struct {
	Vector []uint8
	// contains filtered or unexported fields
}

PSOCrypt object to be used per-client for crypto.

func NewBBCrypt

func NewBBCrypt() *PSOCrypt

Returns a newly allocated PSOCrypt with randomly generated, appropriately sized keys for encrypting packets over PSOBB connections.

func NewPCCrypt

func NewPCCrypt() *PSOCrypt

Returns a newly allocated PSOCrypt with randomly generated, appropriately sized keys for encrypting packets over PSOPC connections.

func (*PSOCrypt) Decrypt

func (crypt *PSOCrypt) Decrypt(data []byte, size uint32)

Decrypt a block of data in place.

func (*PSOCrypt) Encrypt

func (crypt *PSOCrypt) Encrypt(data []byte, size uint32)

Encrypt a block of data in place.

Jump to

Keyboard shortcuts

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