...

Package wsEncryption

import "github.com/Diarkis/diarkis/wsEncryption"
Overview
Index

Overview ▾

func Encrypt

func Encrypt(state *ws.State, data map[string]interface{}) (map[string]interface{}, error)

Encrypte returns encrypted map and error

map structure { ciphertext: <encrypted data encoded as base64>, size: <original data length> }

func Setup

func Setup()

Setup sets up message decryptor for all inbound messages and encrypts all outbound messages

Message must contain the following data format for decryption

{ encrypted: { ciphertext: <encrypted data string encoded as base64>, size: <original data length> } }