crypto

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferSize = 4096

BufferSize buffer size for streaming (64KB is a good balance)

Functions

This section is empty.

Types

type Decrypter

type Decrypter struct {
	Error error
	// contains filtered or unexported fields
}

func NewDecrypter

func NewDecrypter() Decrypter

NewDecrypter returns a new Decrypter instance.

func (Decrypter) By3Des

func (Decrypter) ByAes

func (d Decrypter) ByAes(c *cipher.AesCipher) Decrypter

func (Decrypter) ByBlowfish

func (d Decrypter) ByBlowfish(c *cipher.BlowfishCipher) Decrypter

func (Decrypter) ByChaCha20 added in v1.1.2

func (d Decrypter) ByChaCha20(c *cipher.ChaCha20Cipher) Decrypter

ByChaCha20 decrypts by ChaCha20.

func (Decrypter) ByChaCha20Poly1305 added in v1.1.2

func (d Decrypter) ByChaCha20Poly1305(c *cipher.ChaCha20Poly1305Cipher) Decrypter

ByChaCha20Poly1305 decrypts by ChaCha20-Poly1305.

func (Decrypter) ByDes

func (d Decrypter) ByDes(c *cipher.DesCipher) Decrypter

func (Decrypter) ByRc4

func (d Decrypter) ByRc4(c *cipher.Rc4Cipher) Decrypter

ByRc4 decrypts by RC4.

func (Decrypter) ByRsa

func (d Decrypter) ByRsa(kp *keypair.RsaKeyPair) Decrypter

func (Decrypter) BySalsa20 added in v1.1.3

func (d Decrypter) BySalsa20(c *cipher.Salsa20Cipher) Decrypter

BySalsa20 decrypts by Salsa20.

func (Decrypter) ByTea

func (d Decrypter) ByTea(c *cipher.TeaCipher) Decrypter

ByTea decrypts by TEA.

func (Decrypter) ByTwofish added in v1.1.4

func (d Decrypter) ByTwofish(c *cipher.TwofishCipher) Decrypter

func (Decrypter) FromBase64Bytes

func (d Decrypter) FromBase64Bytes(b []byte) Decrypter

func (Decrypter) FromBase64File

func (d Decrypter) FromBase64File(f fs.File) Decrypter

func (Decrypter) FromBase64String

func (d Decrypter) FromBase64String(s string) Decrypter

func (Decrypter) FromHexBytes

func (d Decrypter) FromHexBytes(b []byte) Decrypter

func (Decrypter) FromHexFile

func (d Decrypter) FromHexFile(f fs.File) Decrypter

func (Decrypter) FromHexString

func (d Decrypter) FromHexString(s string) Decrypter

func (Decrypter) FromRawBytes

func (d Decrypter) FromRawBytes(b []byte) Decrypter

func (Decrypter) FromRawFile

func (d Decrypter) FromRawFile(f fs.File) Decrypter

func (Decrypter) FromRawString

func (d Decrypter) FromRawString(s string) Decrypter

func (Decrypter) ToBytes

func (d Decrypter) ToBytes() []byte

ToBytes outputs as byte slice.

func (Decrypter) ToString

func (d Decrypter) ToString() string

ToString outputs as string.

type Encrypter

type Encrypter struct {
	Error error
	// contains filtered or unexported fields
}

func NewEncrypter

func NewEncrypter() Encrypter

NewEncrypter returns a new Encrypter instance.

func (Encrypter) By3Des

func (Encrypter) ByAes

func (e Encrypter) ByAes(c *cipher.AesCipher) Encrypter

func (Encrypter) ByBlowfish

func (e Encrypter) ByBlowfish(c *cipher.BlowfishCipher) Encrypter

func (Encrypter) ByChaCha20 added in v1.1.2

func (e Encrypter) ByChaCha20(c *cipher.ChaCha20Cipher) Encrypter

ByChaCha20 encrypts by ChaCha20.

func (Encrypter) ByChaCha20Poly1305 added in v1.1.2

func (e Encrypter) ByChaCha20Poly1305(c *cipher.ChaCha20Poly1305Cipher) Encrypter

ByChaCha20Poly1305 encrypts by ChaCha20-Poly1305.

func (Encrypter) ByDes

func (e Encrypter) ByDes(c *cipher.DesCipher) Encrypter

func (Encrypter) ByRc4

func (e Encrypter) ByRc4(c *cipher.Rc4Cipher) Encrypter

ByRc4 encrypts by RC4.

func (Encrypter) ByRsa

func (e Encrypter) ByRsa(kp *keypair.RsaKeyPair) Encrypter

func (Encrypter) BySalsa20 added in v1.1.3

func (e Encrypter) BySalsa20(c *cipher.Salsa20Cipher) Encrypter

BySalsa20 encrypts by Salsa20.

func (Encrypter) ByTea

func (e Encrypter) ByTea(c *cipher.TeaCipher) Encrypter

ByTea encrypts by TEA.

func (Encrypter) ByTwofish added in v1.1.4

func (e Encrypter) ByTwofish(c *cipher.TwofishCipher) Encrypter

func (Encrypter) FromBytes

func (e Encrypter) FromBytes(b []byte) Encrypter

FromBytes encodes from byte slice.

func (Encrypter) FromFile

func (e Encrypter) FromFile(f fs.File) Encrypter

func (Encrypter) FromString

func (e Encrypter) FromString(s string) Encrypter

FromString encodes from string.

func (Encrypter) ToBase64Bytes

func (e Encrypter) ToBase64Bytes() []byte

ToBase64Bytes outputs as base64 byte slice.

func (Encrypter) ToBase64String

func (e Encrypter) ToBase64String() string

ToBase64String outputs as base64 string.

func (Encrypter) ToHexBytes

func (e Encrypter) ToHexBytes() []byte

ToHexBytes outputs as hex byte slice.

func (Encrypter) ToHexString

func (e Encrypter) ToHexString() string

ToHexString outputs as hex string.

func (Encrypter) ToRawBytes

func (e Encrypter) ToRawBytes() []byte

ToRawBytes outputs as raw byte slice without encoding.

func (Encrypter) ToRawString

func (e Encrypter) ToRawString() string

ToRawString outputs as raw string without encoding.

type Signer

type Signer struct {
	Error error
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner() Signer

NewSigner returns a new Signer instance.

func (Signer) ByEd25519 added in v1.1.1

func (s Signer) ByEd25519(kp *keypair.Ed25519KeyPair) Signer

ByEd25519 signs the data using ED25519 digital signature

func (Signer) ByRsa

func (s Signer) ByRsa(kp *keypair.RsaKeyPair) Signer

ByRsa signs the data using RSA digital signature

func (Signer) FromBytes

func (s Signer) FromBytes(b []byte) Signer

func (Signer) FromFile

func (s Signer) FromFile(f fs.File) Signer

func (Signer) FromString

func (s Signer) FromString(str string) Signer

func (Signer) ToBase64Bytes

func (s Signer) ToBase64Bytes() []byte

ToBase64Bytes outputs as base64 byte slice.

func (Signer) ToBase64String

func (s Signer) ToBase64String() string

ToBase64String outputs as base64 string.

func (Signer) ToHexBytes

func (s Signer) ToHexBytes() []byte

ToHexBytes outputs as hex byte slice.

func (Signer) ToHexString

func (s Signer) ToHexString() string

ToHexString outputs as hex string.

func (Signer) ToRawBytes

func (s Signer) ToRawBytes() []byte

ToRawBytes outputs as raw byte slice without encoding.

func (Signer) ToRawString

func (s Signer) ToRawString() string

ToRawString outputs as raw string without encoding.

type Verifier

type Verifier struct {
	Error error
	// contains filtered or unexported fields
}

func NewVerifier

func NewVerifier() Verifier

func (Verifier) ByEd25519 added in v1.1.1

func (v Verifier) ByEd25519(kp *keypair.Ed25519KeyPair) Verifier

ByEd25519 verifies the signature using ED25519 digital signature verification

func (Verifier) ByRsa

func (v Verifier) ByRsa(kp *keypair.RsaKeyPair) Verifier

ByRsa verifies the signature using RSA digital signature verification

func (Verifier) FromBytes

func (v Verifier) FromBytes(b []byte) Verifier

func (Verifier) FromFile added in v1.1.1

func (v Verifier) FromFile(f fs.File) Verifier

func (Verifier) FromString

func (v Verifier) FromString(s string) Verifier

func (Verifier) ToBool

func (v Verifier) ToBool() bool

func (Verifier) WithBase64Sign added in v1.1.2

func (v Verifier) WithBase64Sign(s []byte) Verifier

func (Verifier) WithHexSign added in v1.1.2

func (v Verifier) WithHexSign(s []byte) Verifier

func (Verifier) WithRawSign added in v1.1.2

func (v Verifier) WithRawSign(s []byte) Verifier

Directories

Path Synopsis
Package triple_des implements Triple DES encryption and decryption with streaming support.
Package triple_des implements Triple DES encryption and decryption with streaming support.
Package aes implements AES encryption and decryption with streaming support.
Package aes implements AES encryption and decryption with streaming support.
Package blowfish implements Blowfish encryption and decryption with streaming support.
Package blowfish implements Blowfish encryption and decryption with streaming support.
Package chacha20 implements ChaCha20 encryption and decryption with streaming support.
Package chacha20 implements ChaCha20 encryption and decryption with streaming support.
Package chacha20poly1305 implements ChaCha20-Poly1305 authenticated encryption and decryption with streaming support.
Package chacha20poly1305 implements ChaCha20-Poly1305 authenticated encryption and decryption with streaming support.
Package cipher provides cryptographic cipher configuration and base functionality.
Package cipher provides cryptographic cipher configuration and base functionality.
Package des implements DES encryption and decryption with streaming support.
Package des implements DES encryption and decryption with streaming support.
Package ed25519 implements ED25519 digital signature generation and verification with streaming support.
Package ed25519 implements ED25519 digital signature generation and verification with streaming support.
Package keypair provides cryptographic key pair management functionality.
Package keypair provides cryptographic key pair management functionality.
Package rc4 implements RC4 encryption and decryption with streaming support
Package rc4 implements RC4 encryption and decryption with streaming support
Package rsa implements RSA encryption, decryption, signing, and verification with streaming support.
Package rsa implements RSA encryption, decryption, signing, and verification with streaming support.
Package salsa20 implements Salsa20 encryption and decryption with streaming support.
Package salsa20 implements Salsa20 encryption and decryption with streaming support.
Package tea implements TEA encryption and decryption with streaming support.
Package tea implements TEA encryption and decryption with streaming support.
Package twofish implements Twofish encryption and decryption with streaming support.
Package twofish implements Twofish encryption and decryption with streaming support.

Jump to

Keyboard shortcuts

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