monocypher

package module
v0.0.0-...-c9fccdb Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 2 Imported by: 0

README

Go bindings for Monocypher, a simple and secure cryptography library. Credits to @demonshreder for the initial implementation. Please note that I will not be adding new Monocypher functions or features, and that I will only fix security issues for this repository.

Installation

go get -u -v github.com/HACKERALERT/monocypher-go

Usage

package main

import (
	"github.com/HACKERALERT/monocypher-go"
)

func main(){
	key := make([]byte, 32)
	nonce := make([]byte, 24)
	plaintext := []byte("In cryptography we trust!")
	mac, ciphertext := monocypher.Lock(plaintext, nonce, key)
	// .....
}

See monocypher.go for more functions and details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMessageSignature

func CheckMessageSignature(message, publicKey, signature []byte) (result bool)

func GenPublicKey

func GenPublicKey(secretKey []byte) (publicKey []byte)

func Lock

func Lock(plaintext, nonce, key []byte) (mac, ciphertext []byte)

func LockAead

func LockAead(plaintext, nonce, key, addData []byte) (mac, ciphertext, data []byte)

func SignMessage

func SignMessage(message, secretKey []byte) (signature, publicKey []byte)

func Unlock

func Unlock(ciphertext, nonce, key, mac []byte) (plaintext []byte, authentic bool)

func UnlockAead

func UnlockAead(ciphertext, nonce, key, mac, addData []byte) (plaintext []byte, authentic bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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