gmono256

package
v0.0.0-...-5d13315 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToAlphabet

func Base64ToAlphabet(b64s string) (*alphabet, error)

Base64ToAlphabet convert base64 string to 256 bytes alphabet.

func NewMono256Maker

func NewMono256Maker(b64alphabet string) (gcrypto.CipherRWCMaker, error)

func NewRandKeyBase64

func NewRandKeyBase64() string

NewRandKeyBase64 generates random key in base64 format.

Types

type Mono256Cipher

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

Mono256Cipher is monoalphabetic cipher codec

func NewMono256

func NewMono256(encAlphabet *alphabet) *Mono256Cipher

NewMono256 create new monoalphabetic cipher codec.

func (*Mono256Cipher) Decrypt

func (cipher *Mono256Cipher) Decrypt(b []byte) error

Decrypt from ciphertext data to plaintext. It implements `EqLenCipher` interface.

func (*Mono256Cipher) Encrypt

func (cipher *Mono256Cipher) Encrypt(b []byte) error

Encrypt plaintext data to ciphertext. It implements `EqLenCipher` interface.

type Mono256Maker

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

func (*Mono256Maker) Make

func (m *Mono256Maker) Make(rwc io.ReadWriteCloser, genNonce bool, timeout *time.Duration, nonceCodec gcrypto.EqLenCipher) (gcrypto.CipherRWC, error)

func (*Mono256Maker) NonceSize

func (m *Mono256Maker) NonceSize() int

Jump to

Keyboard shortcuts

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