crypto

package
v0.0.0-...-8fbeb48 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package crypto is only meant to be used by Scytale.

The functions in this package are not meant to be fool-proof abstractions for the underlying crypto API. Encrypt and Decrypt always use 0 as the nonce. This is acceptable for Scytale because the key is only used once. In other scenarios, this could completely compromise the security of your application. Please don't use this in your own application.

Index

Constants

View Source
const KeySize = 16

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, key Key) ([]byte, error)

Decrypt decrypts the given data with the given key. The nonce is expected to be 0.

Types

type Key

type Key [KeySize]byte

func Encrypt

func Encrypt(data []byte) (Key, []byte, error)

Encrypt encrypts the given data with a randomly generated key. The nonce is set to 0.

func (Key) String

func (k Key) String() string

String implements the fmt.Stringer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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