des

package
v0.0.0-...-e758773 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package des implements the Data Encryption Standard (DES) and the Triple Data Encryption Algorithm (TDEA) as defined in U.S. Federal Information Processing Standards Publication 46-3.

Index

Constants

View Source
const BlockSize = 8

The DES block size in bytes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

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

Cipher is an instance of DES encryption.

func NewCipher

func NewCipher(key []byte) (*Cipher, os.Error)

NewCipher creates and returns a new Cipher.

func (*Cipher) BlockSize

func (c *Cipher) BlockSize() int

BlockSize returns the DES block size, 8 bytes.

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(dst, src []byte)

Decrypts the 8-byte buffer src and stores the result in dst.

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(dst, src []byte)

Encrypts the 8-byte buffer src and stores the result in dst. Note that for amounts of data larger than a block, it is not safe to just call Encrypt on successive blocks; instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).

func (*Cipher) Reset

func (c *Cipher) Reset()

Reset zeros the key data, so that it will no longer appear in the process's memory.

type KeySizeError

type KeySizeError int

func (KeySizeError) String

func (k KeySizeError) String() string

type TripleDESCipher

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

A TripleDESCipher is an instance of TripleDES encryption.

func NewTripleDESCipher

func NewTripleDESCipher(key []byte) (*TripleDESCipher, os.Error)

NewCipher creates and returns a new Cipher.

func (*TripleDESCipher) BlockSize

func (c *TripleDESCipher) BlockSize() int

BlockSize returns the TripleDES block size, 8 bytes. It is necessary to satisfy the Block interface in the package "crypto/cipher".

func (*TripleDESCipher) Decrypt

func (c *TripleDESCipher) Decrypt(dst, src []byte)

Decrypts the 8-byte buffer src and stores the result in dst.

func (*TripleDESCipher) Encrypt

func (c *TripleDESCipher) Encrypt(dst, src []byte)

Encrypts the 8-byte buffer src and stores the result in dst. Note that for amounts of data larger than a block, it is not safe to just call Encrypt on successive blocks; instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).

func (*TripleDESCipher) Reset

func (c *TripleDESCipher) Reset()

Reset zeros the key data, so that it will no longer appear in the process's memory.

Jump to

Keyboard shortcuts

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