multiparty

package
v0.0.0-...-61777e6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package multiparty implements the Cryptodog Multiparty Protocol as used in Cryptodog version 2.5.0, and previously, Cryptocat 2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(password string) []byte

func HMAC

func HMAC(msg, key []byte) string

func IsElem

func IsElem(element string, array []string) bool

func MessageTag

func MessageTag(message []byte) string

func Sha512

func Sha512(input []byte) []byte

Types

type Answer

type Answer struct {
	Type string                 `json:"type"`
	Text map[string]*TextAnswer `json:"text"`
	Tag  string                 `json:"tag,omitempty"`
}

type Buddy

type Buddy struct {
	CryptoEnabled bool
	PublicKey     [32]byte
	MpSecretKey   *MPStorage
	HMAC          string
}

type KeyExMessage

type KeyExMessage struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type MPStorage

type MPStorage struct {
	Message []byte
	HMAC    []byte
}

type Me

type Me struct {
	Name      string
	UsedIVs   []string
	SecretKey [32]byte
	PublicKey [32]byte
	SentKey   bool
	Buddies   map[string]*Buddy
	// contains filtered or unexported fields
}

func NewMe

func NewMe(username string, profile string) (*Me, error)

func (*Me) BlacklistUser

func (me *Me) BlacklistUser(nick string)

func (*Me) DestroyUser

func (me *Me) DestroyUser(name string)

func (*Me) FP

func (me *Me) FP(nick string) string

func (*Me) FingerprintUser

func (me *Me) FingerprintUser(username string) (string, error)

func (*Me) GenerateKeys

func (me *Me) GenerateKeys()

func (*Me) KeyWasSent

func (m *Me) KeyWasSent(u string) bool

func (*Me) MessageSender

func (me *Me) MessageSender(f func([]byte))

func (*Me) ReceiveMessage

func (me *Me) ReceiveMessage(sender, message string) ([]byte, error)

func (*Me) RequestPublicKey

func (me *Me) RequestPublicKey(s string)

func (*Me) SaveProfile

func (me *Me) SaveProfile() string

func (*Me) SendMessage

func (me *Me) SendMessage(message []byte) []byte

func (*Me) SendPublicKey

func (me *Me) SendPublicKey(nick string) string

func (*Me) Shutdown

func (me *Me) Shutdown()

func (*Me) TransmitPublicKey

func (me *Me) TransmitPublicKey(who string)

func (*Me) UnblacklistUser

func (me *Me) UnblacklistUser(nick string)

type TextAnswer

type TextAnswer struct {
	Message string `json:"message"`
	IV      string `json:"iv,omitempty"`
	Tag     string `json:"tag,omitempty"`
	HMAC    string `json:"hmac,omitempty"`
}

Jump to

Keyboard shortcuts

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