multiparty

package
v0.0.0-...-b1dd1d8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 17 Imported by: 1

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 {
	MaximumMessageSize int
	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) ClearBlacklist

func (me *Me) ClearBlacklist()

func (*Me) DestroyUser

func (me *Me) DestroyUser(name string)

func (*Me) Fingerprint

func (me *Me) Fingerprint(username string) string

func (*Me) FingerprintUser

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

func (*Me) GenerateKeys

func (me *Me) GenerateKeys()

func (*Me) IsSessionInitialized

func (me *Me) IsSessionInitialized(nickname string) bool

func (*Me) NamesByFingerprint

func (me *Me) NamesByFingerprint(fp string) []string

func (*Me) Out

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

func (*Me) ReceiveMessage

func (me *Me) ReceiveMessage(sender, message string) (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)

func (*Me) SendPublicKey

func (me *Me) SendPublicKey(nick string)

func (*Me) Shutdown

func (me *Me) Shutdown()

func (*Me) SortedNames

func (me *Me) SortedNames() []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