des

package
v0.0.0-...-d6a7222 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
	http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
	http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package des provides wrapper methods on top of the DES cipher for our own usage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher

type Cipher struct {
	KeyBlock cipher.Block
	KeyBytes []byte
}

Cipher is wrapper of the DES or 3DES cipher and stores the raw key bytes

func CreateFromDESKeyBytes

func CreateFromDESKeyBytes(keyBytes []byte) (Cipher, error)

func CreateFromDESKeyString

func CreateFromDESKeyString(key string) (Cipher, error)

func CreateFromTripleDESKeyBytes

func CreateFromTripleDESKeyBytes(keyBytes []byte) (Cipher, error)

func CreateFromTripleDESKeyString

func CreateFromTripleDESKeyString(key string) (Cipher, error)

func (*Cipher) CheckValue

func (cipher *Cipher) CheckValue() string

func (*Cipher) Decrypt

func (cipher *Cipher) Decrypt(cipherBytes []byte) ([]byte, error)

func (*Cipher) DecryptHex

func (cipher *Cipher) DecryptHex(ciphertext string) ([]byte, error)

func (*Cipher) Encrypt

func (cipher *Cipher) Encrypt(plainBytes []byte) ([]byte, error)

func (*Cipher) EncryptHex

func (cipher *Cipher) EncryptHex(plaintext string) ([]byte, error)

func (*Cipher) VerifyCheckValue

func (cipher *Cipher) VerifyCheckValue(checkValue string) bool

Jump to

Keyboard shortcuts

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