des
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package des implements the Data Encryption Standard (DES) and theTriple Data Encryption Algorithm (TDEA) as definedin U.S. Federal Information Processing Standards Publication 46-3.
DES is cryptographically broken and should not be used for secureapplications.
Index¶
Examples¶
Constants¶
const BlockSize = 8The DES block size in bytes.
Variables¶
This section is empty.
Functions¶
funcNewCipher¶
NewCipher creates and returns a newcipher.Block.
funcNewTripleDESCipher¶
NewTripleDESCipher creates and returns a newcipher.Block.
Example¶
package mainimport ("crypto/des")func main() {// NewTripleDESCipher can also be used when EDE2 is required by// duplicating the first 8 bytes of the 16-byte key.ede2Key := []byte("example key 1234")var tripleDESKey []bytetripleDESKey = append(tripleDESKey, ede2Key[:16]...)tripleDESKey = append(tripleDESKey, ede2Key[:8]...)_, err := des.NewTripleDESCipher(tripleDESKey)if err != nil {panic(err)}// See crypto/cipher for how to use a cipher.Block for encryption and// decryption.}