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.

cipher.go

Constants

  1. func NewCipher(key []byte) (.Block, )

NewCipher creates and returns a new cipher.Block.

func NewTripleDESCipher

NewTripleDESCipher creates and returns a new cipher.Block.


Example:

  1. // NewTripleDESCipher can also be used when EDE2 is required by
  2. // duplicating the first 8 bytes of the 16-byte key.
  3. ede2Key := []byte("example key 1234")
  4. tripleDESKey = append(tripleDESKey, ede2Key[:16]...)
  5. _, err := des.NewTripleDESCipher(tripleDESKey)
  6. panic(err)
  7. }
  8. // See crypto/cipher for how to use a cipher.Block for encryption and