secretcrypt

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package secretcrypt implements passphrase based encryption/decryption with a simple interface.

The format used is guaranteed to never change. Any such change will some in the form of a different package rather than evolving this implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(passphrase string, crypttext []byte) ([]byte, error)

Decrypt decrypts a sequence of bytes previously created with Encrypt.

Errors conditions include (but may not be limited to):

  • The input is truncated.
  • The input is otherwise invalid (arbitrary corruption).
  • The passphrase does not match that which was used during encryption.

There is no way to tell programatically whether an error is due to a bad passphrase or for other reasons.

func Encrypt

func Encrypt(passphrase string, plaintext []byte) ([]byte, error)

Encrypt encrypts bytes using a passphrase.

Returns encrypted bytes and an error, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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