goax

package module
v0.0.0-...-87c7ef4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Unlicense Imports: 13 Imported by: 0

README

Goax Mobile

A golang mobile (gomobile) compatible version of the Axolotl ratchet forked from @rakoo's goax package.

https://github.com/rakoo/goax

This is very experimental. The current (1.5) version of Gomobile is very restrictive and requires work to repurpose existing golang packages.

In addition, this version of Axolotl is completely out of date. It was based on @agl's pond code.

Don't use this for anything important.

At some point, this will support iOS, Android, and server encrypted messaging with a single golang codebase.

Documentation

Overview

Package ratchet implements the axolotl ratchet, by Trevor Perrin. See https://github.com/trevp/axolotl/wiki.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyExchange

type KeyExchange struct {
	IdentityPublic []byte `bencode:"identity"`
	Dh             []byte `bencode:"dh"`
	Dh1            []byte `bencode:"dh1"`
}

func (KeyExchange) MarshalJSON

func (k KeyExchange) MarshalJSON() ([]byte, error)

MarshalJSON makes the KeyExchange a json.Marshaler by hex-ing fields before putting them in the json

func (*KeyExchange) UnmarshalJSON

func (k *KeyExchange) UnmarshalJSON(in []byte) error

UnmarshalJSON makes the *KeyExchange a json.Unmarshaler by un-hex-ing fields after taking them from the json

type Ratchet

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

Ratchet contains the per-contact, crypto state.

func New

func New(myPriv []byte) *Ratchet

func (*Ratchet) CompleteKeyExchange

func (r *Ratchet) CompleteKeyExchange(kx *KeyExchange) error

CompleteKeyExchange takes a KeyExchange message from the other party and establishes the ratchet.

func (*Ratchet) Decrypt

func (r *Ratchet) Decrypt(ciphertext []byte) ([]byte, error)

func (*Ratchet) Encrypt

func (r *Ratchet) Encrypt(msg []byte) []byte

Encrypt acts like append() but appends an encrypted version of msg to out.

func (*Ratchet) GetKeyExchangeMaterial

func (r *Ratchet) GetKeyExchangeMaterial() (kx *KeyExchange, err error)

GetKeyExchangeMaterial returns key exchange information from the ratchet.

func (*Ratchet) MyPriv

func (r *Ratchet) MyPriv() string

MyPriv returns the hex-encoded private DH key

Directories

Path Synopsis
example
cui

Jump to

Keyboard shortcuts

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