s2k

package
Version: v0.0.0-...-7a1a713 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2013 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashIdToHash

func HashIdToHash(id byte) (h crypto.Hash, ok bool)

HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP hash id.

func HashToHashId

func HashToHashId(h crypto.Hash) (id byte, ok bool)

HashIdToHash returns an OpenPGP hash id which corresponds the given Hash.

func Iterated

func Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int)

Iterated writes to out the result of computing the Iterated and Salted S2K function (RFC 4880, section 3.7.1.3) using the given hash, input passphrase, salt and iteration count.

func Parse

func Parse(r io.Reader) (f func(out, in []byte), err error)

Parse reads a binary specification for a string-to-key transformation from r and returns a function which performs that transform.

func Salted

func Salted(out []byte, h hash.Hash, in []byte, salt []byte)

Salted writes to out the result of computing the Salted S2K function (RFC 4880, section 3.7.1.2) using the given hash, input passphrase and salt.

func Serialize

func Serialize(w io.Writer, key []byte, rand io.Reader, passphrase []byte) error

Serialize salts and stretches the given passphrase and writes the resulting key into key. It also serializes an S2K descriptor to w.

func Simple

func Simple(out []byte, h hash.Hash, in []byte)

Simple writes to out the result of computing the Simple S2K function (RFC 4880, section 3.7.1.1) using the given hash and input passphrase.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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