cryptomarinara

package module
v0.0.0-...-840acdd Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 3 Imported by: 0

README

cryptomarinara

This repo is some simple wrappers around cryptopasta that I found myself writing frequently.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

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

Cipher struct for storing encryption key and wrapping it for encryption/decryption.

func NewFromBytes

func NewFromBytes(b []byte) (*Cipher, error)

NewFromBytes initializes a new Cipher using a byte slice.

func NewFromHexString

func NewFromHexString(s string) (*Cipher, error)

NewFromHexString initializes a new Cipher using a hex string

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt wrapper for decrypting using the globally defined key.

func (*Cipher) DecryptHexString

func (c *Cipher) DecryptHexString(ciphertext string) ([]byte, error)

DecryptHexString convenience method. This method expects the encrypted string to have been hex encoded.

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(plaintext []byte) ([]byte, error)

Encrypt the given plaintext.

func (*Cipher) EncryptString

func (c *Cipher) EncryptString(plaintext string) ([]byte, error)

EncryptString convenience method to Encrypt

Jump to

Keyboard shortcuts

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