ssm

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DECIMALIZATION_TABLE string = "0123456789012345"

Variables

View Source
var BadPins []int
View Source
var ZeroIv []byte = []byte{0, 0, 0, 0, 0, 0, 0, 0}

Functions

func AesDecrypt

func AesDecrypt(kaeyB64, ivB64, textB64 string) (string, error)

func AesEncrypt

func AesEncrypt(kaeyB64, ivB64, text string) (string, error)

func Decimalize

func Decimalize(notDecimaliz string, length int, immediate bool) string

func DecryptDes

func DecryptDes(cipherB64, keyB64 string) (string, error)

func DecryptDesBothHex

func DecryptDesBothHex(cipherHex, keyHex string) (string, error)

func DecryptDesHex

func DecryptDesHex(cipherHex, keyB64 string) (string, error)

func DecryptRsa

func DecryptRsa(ks1 keystore.KeyStore, keyId, pass, data string) (string, error)

func EncryptCvv

func EncryptCvv(tspB64, cvkB64 string) (string, error)

func EncryptDes

func EncryptDes(textB64, keyB64 string) (string, error)

func EncryptDesHex

func EncryptDesHex(textHex, keyB64 string) (string, error)

func EncryptRsa

func EncryptRsa(ks1 keystore.KeyStore, keyId, data string) (string, error)

func ExtractPanFromCard

func ExtractPanFromCard(card string) (string, error)

func GenCvv

func GenCvv(pan, exp, service, cvkB64 string) (string, error)

func GenerateOffset

func GenerateOffset(card, pvkB64, pin string, pinlen int) (string, error)

func GeneratePinBlock

func GeneratePinBlock(pan, tpkB64, pin string) (string, error)

func GeneratePvv

func GeneratePvv(card, pvkB64, pvki, pin string) (string, error)

func GenerateRandomPin

func GenerateRandomPin(len int) string

func Initialize

func Initialize()

func IsPinEasy

func IsPinEasy(pin int) bool

func PKCS7Padding

func PKCS7Padding(ciphertext []byte) []byte

func PKCS7UnPadding

func PKCS7UnPadding(plantText []byte) []byte

func PinBlock

func PinBlock(pan, pin, tpk string) (string, error)

func RandomData

func RandomData(len int) string

28cEVB4BUE7GKNwjuRhN3szK5E3!&q*y

func ReadKeyStore

func ReadKeyStore(filename string, password []byte) keystore.KeyStore

func SubTen

func SubTen(pin, decimalized string, length int) (string, error)

func WriteKeyStore

func WriteKeyStore(ks keystore.KeyStore, filename string, password []byte)

func Zeroing

func Zeroing(buf []byte)

Types

type DesMode

type DesMode int
const (
	Ecb DesMode = iota + 1
	Cbc
)

type Ssm

type Ssm struct {
	Cvk  string
	Pvk  string
	Tpk  string
	Csd  string
	Pvki string
}

func Init

func Init(cvk, pvk, tpk string) (*Ssm, error)

func (*Ssm) Crypt

func (s *Ssm) Crypt(data, mode string) (string, error)

func (*Ssm) Cvv

func (s *Ssm) Cvv(pan, exp, cvvType string) (string, error)

func (*Ssm) Cvv2Padding added in v0.16.3

func (s *Ssm) Cvv2Padding(cvv2 string) (string, error)

func (*Ssm) GetKey

func (s *Ssm) GetKey(id string) string

func (*Ssm) Mac

func (s *Ssm) Mac(data string) (string, error)

func (*Ssm) Offset

func (s *Ssm) Offset(pan, pinBlock string) (string, error)

func (*Ssm) PinBlock

func (s *Ssm) PinBlock(pan, pin string) (string, error)

func (*Ssm) PinBlockDecode

func (s *Ssm) PinBlockDecode(pan, pinBlock string) (string, error)

func (*Ssm) Pvv

func (s *Ssm) Pvv(pan, pinBlock string) (string, error)

func (*Ssm) SetKey

func (s *Ssm) SetKey(id, value string)

func (*Ssm) Translate

func (s *Ssm) Translate(pan, pinBlock, tpk2nd string) (string, error)

Jump to

Keyboard shortcuts

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