encryption

package
v0.0.0-...-34f5af7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Most of this code is copied from the golang.org/x/crypto/blowfish package.

Source modified to work with the customized PSOBB Blowfish implementation, which uses fewer rounds. Work based off of the encryption library written by Fuzziqer Software (http://www.fuzziqersoftware.com/).

* Blowfish implementation adapted to work with PSOBB's protocol.

PSOPC encryption algorithm.

The cipher used PC/Gamecrube is not symmetrical in that decrypting a block previously encrypted with this cipher will not yield the same result due (I think) to the key rotations.

Index

Constants

View Source
const BlowfishBlockSize = 8

BlowfishBlockSize is the Blowfish block size in bytes.

View Source
const PSOPCBlockSize = 4

PSOPCBlockSize is the number of bytes the block cipher operates on at once.

Variables

This section is empty.

Functions

This section is empty.

Types

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 NewBBCryptWithVector

func NewBBCryptWithVector(vector []uint8) *PSOCrypt

func NewPCCrypt

func NewPCCrypt() *PSOCrypt

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

func NewPCCryptWithVector

func NewPCCryptWithVector(vector []uint8) *PSOCrypt

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