crypto

package
v0.0.0-...-0763949 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package crypto used to encrypt communication channel.

After establishing a connection to a CM server, the server and client go through a handshake process that establishes an encrypted connection. Client messages are encrypted using AES with a session key that is generated by the client during the handshake. There exists evidence that a connection can be unencrypted, because of the export restriction of strong cryptography from the US, but it has not been observed.

Steps: 1. Server requests the client to encrypt traffic within the specified universe (normally Public) 2. Client generates a 256bit session key. 3. This key is encrypted by a 1024bit public RSA key for the specific universe. 4. The encrypted key is sent to the server, along with a 32bit crc of the encrypted key. 5. The server replies with an unencrypted success/failure message. 6. All traffic from here is AES encrypted with the session key.

Symmetric crypto * All messages after the handshake are AES encrypted. * A random 16 byte IV is generated for every message. * This IV is AES encrypted in ECB mode using the session key generated during the handshake. * Message data is encrypted with AES using the generated (not encrypted) IV and session key in CBC mode. * The encrypted IV and encrypted message data are concatenated together and sent off.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aes

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

Aes is data encryptor

func NewAes

func NewAes(b cipher.Block) *Aes

NewAes initialize new instance of Aes.

func (*Aes) Decrypt

func (c *Aes) Decrypt(src []byte) []byte

Decrypts data from the reader using AES/CBC/PKCS7 with an IV prepended using AES/ECB/None. The src slice may not be used anymore.

func (*Aes) Encrypt

func (c *Aes) Encrypt(src []byte) ([]byte, error)

Encrypt performs an encryption using AES/CBC/PKCS7 with a random IV prepended using AES/ECB/None.

type ChannelReadyEvent

type ChannelReadyEvent struct{}

ChannelReadyEvent is fired when successful EncryptResult is received, and channel is encrypted.

type Module

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

Module used to encrypt communication channel.

func NewModule

func NewModule(cl *steamprotocol.Client, eventManager *steamprotocol.EventManager) *Module

NewModule initialize new instance of crypto Module.

func (*Module) Subscribe

func (m *Module) Subscribe()

Subscribe used to start listen event and packets from eventManager.

Jump to

Keyboard shortcuts

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