cipherpaykit

package module
v0.0.0-...-7f1fd1c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

CipherPayKit

Overview

CipherPayKit is a versatile library providing cryptographic operations and payment validation functions.

Status

CipherPayKit aims to provide convenient payment cryptograph related functionalities. It is still under development.

Usage

LIB
go get github.com/veszok/cipherpaykit
CLI
go install github.com/veszok/cipherpaykit

Use cipherpaykit help to get the usage details as below:

USAGE:
   cipherpaykit [command [subcommand]] [flags...]

COMMANDS:
   help    Shows a list of commands or help for one command
   tdes    Encrypts/Decrypts data using triple DES algorithm
   kcv     Calculates Key Check Value for the given key

SUBCOMMANDS:
   tdes:
      enc  Encrytps data using triple DES
	  dec  Decrypts data using triple DES
FLAGS:
   --key   Key data
   --mode  Block mode: ecb, cbc. Default: ecb
   --data  Data to be encrypted/decrypted
   --iv    Initialization vector (mandatory for CBC block mode)

Example:

cipherpaykit tdes dec --mode ecb --key 303132333435303132333435303132333435303132333435 --data ba1e59ff04413cd902b85219a34d2cb4 61616161616161616262626262626262

Please note current version only supports hexdecimal string format for input key/data. More format (Ascii, Base64, etc.) will be added in later versions.

License

CipherPayKit is released under the Apache 2.0 license. See LICENSE.txt

Documentation

Overview

Package tripledes implements payment related utility functions.

Package tripledes implements convenient functions to encrypt/decrypt data using Triple DES algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptTripleDesCbc

func DecryptTripleDesCbc(inputKey []byte, data []byte, iv []byte) ([]byte, error)

DecryptTripleDesCbc decrypts data with key and iv using Triple DES under CBC mode

func DecryptTripleDesEcb

func DecryptTripleDesEcb(inputKey []byte, data []byte) ([]byte, error)

DecryptTripleEcb decrypts data with key using Triple DES under ECB mode

func EncryptTripleDesCbc

func EncryptTripleDesCbc(inputKey []byte, data []byte, iv []byte) ([]byte, error)

EncryptTripleDesCbc encrypts data with key and iv using Triple DES under CBC mode

func EncryptTripleDesEcb

func EncryptTripleDesEcb(inputKey []byte, data []byte) ([]byte, error)

EncryptTripleDesEcb encrypts data with key using Triple DES under ECB mode

func GenerateKcv

func GenerateKcv(key []byte) (string, error)

GenerateKcv generates the Key Check Value of the given key

Types

This section is empty.

Directories

Path Synopsis
cmd
cli command
internal
kcv

Jump to

Keyboard shortcuts

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