des

package
v0.0.0-...-49c7f14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: MIT, BSD-3-Clause Imports: 0 Imported by: 2

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.

DES is cryptographically broken and should not be used for secure applications.

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 uint64) *Cipher

NewCipher creates and returns a new Cipher.

func (*Cipher) DecryptBlock

func (c *Cipher) DecryptBlock(block uint64) uint64

func (*Cipher) EncryptBlock

func (c *Cipher) EncryptBlock(block uint64) uint64

type Cracker

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

Cracker is an instance of DES encryption.

func NewCracker

func NewCracker(in, out uint64) *Cracker

NewCracker creates and returns a new Cracker.

func (*Cracker) CheckKey

func (c *Cracker) CheckKey(permutedKey uint64) (key uint64, ok bool)

CheckKey checks whether the given permuted 56-bit key encrypts to the cipher text and returns the key in the format used by des.Cipher.

func (*Cracker) SearchKey

func (c *Cracker) SearchKey(min, max uint64) (key uint64, ok bool)

type TripleDESCipher

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

A TripleDESCipher is an instance of TripleDES encryption.

func NewTripleDESCipher

func NewTripleDESCipher(key [3]uint64) *TripleDESCipher

NewTripleDESCipher creates and returns a new TripleDESCipher.

func (*TripleDESCipher) DecryptBlock

func (c *TripleDESCipher) DecryptBlock(block uint64) uint64

func (*TripleDESCipher) EncryptBlock

func (c *TripleDESCipher) EncryptBlock(block uint64) uint64

Jump to

Keyboard shortcuts

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