ciph

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package ciph manages encryption ciphers and encrypting blobs of data. Keys are generated using ECDH from a public and private secp256k1 combined, as well as directly from a 32 byte secret in the form of a static array as used in most cryptographic hash function implementations in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockFromHash

func BlockFromHash(h sha256.Hash) (block cipher.Block)

BlockFromHash creates an AES block cipher from an sha256.Hash.

func Encipher

func Encipher(blk cipher.Block, n nonce.IV, b []byte)

Encipher XORs the data with the block stream. This encrypts unencrypted data and decrypts encrypted data. If the cipher.Block is nil, it panics (this should never happen).

func GetBlock

func GetBlock(from *crypto.Prv, to *crypto.Pub, note string) (block cipher.Block)

GetBlock returns a block cipher with a secret generated from the provided keys using ECDH.

Types

This section is empty.

Jump to

Keyboard shortcuts

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