Movatterモバイル変換


[0]ホーム

URL:


des

packagestandard library
go1.25.5Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:7Imported by:6,441

Details

Repository

cs.opensource.google/go/go

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

View Source
const BlockSize = 8

The DES block size in bytes.

Variables

This section is empty.

Functions

funcNewCipher

func NewCipher(key []byte) (cipher.Block,error)

NewCipher creates and returns a newcipher.Block.

funcNewTripleDESCipher

func NewTripleDESCipher(key []byte) (cipher.Block,error)

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.}

Types

typeKeySizeError

type KeySizeErrorint

func (KeySizeError)Error

func (kKeySizeError) Error()string

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp