cryptoKit

package module
v0.0.0-...-4e18145 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 15 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cryptoKit 本文件来自于gogf/gf的crypto/gaes/gaes.go

Package cryptoKit 加密工具包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptCBC

func AESDecryptCBC(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)

AESDecryptCBC AES使用CBC模式解密

  • 注意,密钥必须是16/24/32位长度
  • @param cipherText 加密字符串
  • @param key 密钥
  • @param iv 向量

func AESDecryptCFB

func AESDecryptCFB(cipherText []byte, key []byte, unPadding int, iv ...[]byte) ([]byte, error)

AESDecryptCFB AES CFB解密

  • 注意,密钥必须是16/24/32位长度。
  • @param cipherText 密文
  • @param key 密钥
  • @param unPadding 去填充
  • @param iv 向量

func AESEncryptCBC

func AESEncryptCBC(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)

AESEncryptCBC AES使用CBC模式加密

  • 注意,密钥必须是16/24/32位长度
  • @param plainText 待加密内容
  • @param key 密钥
  • @param iv 向量

func AESEncryptCFB

func AESEncryptCFB(plainText []byte, key []byte, padding *int, iv ...[]byte) ([]byte, error)

AESEncryptCFB AEC CFB模式加密

  • 注意,密钥必须是16/24/32位长度。
  • @param plainText 明文
  • @param key 密钥
  • @param padding 填充
  • @param iv 向量

func Base64Decode

func Base64Decode(str string) (string, error)

Base64Decode Base64解密 *

  • @param str 解密字符串
  • @return 解密结果

func Base64Encode

func Base64Encode(str string) string

Base64Encode Base64加密 *

  • @param str 加密字符串
  • @return 加密结果

func Hmac256

func Hmac256(str, secret string) string

Hmac256 Hmac256加密

  • @param str 加密字符串
  • @param secret 加密密钥
  • @return 加密结果

func Md5

func Md5(str string) string

Md5 Md5加密 *

  • @param str 加密字符串
  • @return 加密结果 32个字符小写

func Md5ToUpper

func Md5ToUpper(str string) string

Md5ToUpper Md5加密大写 *

  • @param str 加密字符串
  • @return 加密结果 32个字符大写

func PKCS5Padding

func PKCS5Padding(src []byte, blockSize int) []byte

PKCS5Padding 填充

func PKCS5UnPadding

func PKCS5UnPadding(src []byte, blockSize int) ([]byte, error)

PKCS5UnPadding 反填充

func Sha256

func Sha256(str string) string

Sha256 Sha256加密 *

  • @param str 加密字符串
  • @return 加密结果 32个字符小写

func Sha256ToUpper

func Sha256ToUpper(str string) string

Sha256ToUpper Sha256加密大写 *

  • @param str 加密字符串
  • @return 加密结果 32个字符大写

func UnicodeDecode

func UnicodeDecode(str string) (string, error)

UnicodeDecode 将Unicode编码转为字符串 *

  • @param str Unicode编码字符串
  • @return 字符串

func UnicodeEncode

func UnicodeEncode(str string) string

UnicodeEncode 将字符串转为Unicode编码 *

  • @param str 字符串
  • @return Unicode编码字符串

func UrlDecode

func UrlDecode(str string) (string, error)

UrlDecode URL解码 *

  • @param str 待解码字符串
  • @return 解码结果

func UrlEncode

func UrlEncode(str string) string

UrlEncode URL编码 *

  • @param str 待编码字符串
  • @return 编码结果

func ZeroPadding

func ZeroPadding(cipherText []byte, blockSize int) ([]byte, int)

ZeroPadding 零填充

  • @param cipherText 密文
  • @param blockSize 块大小

func ZeroUnPadding

func ZeroUnPadding(plaintext []byte, unPadding int) []byte

ZeroUnPadding 零未填充

  • @param plaintext 明文
  • @param unPadding 去除数据中的填充

Types

This section is empty.

Jump to

Keyboard shortcuts

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