cryptogo

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 24 Imported by: 1

README

crypto-go

Go library of crypto standards.

Installation

To install crypto-go, use go get:

go get github.com/trumanwong/cryptogo

Usage

package yours

import (
	"fmt"
	"trumanwong/cryptogo"
)

func main()  {
    fmt.Println(cryptogo.MD5("message"))
}

Finished encrypt functions

  • md5
  • sha1
  • sha224
  • sha256
  • sha384
  • sha512
  • sha3-224
  • sha3-256
  • sha3-384
  • sha3-512

  • hmac-md5
  • hmac-sha1
  • hmac-sha224
  • hmac-sha256
  • hmac-sha512
  • hmac-sha384
  • hmac-ripemd160
  • hmac-sha3-224
  • hmac-sha3-256
  • hmac-sha3-384
  • hmac-sha3-512

  • rc4

  • bcrypt

  • hex
  • base64

  • morse code encryption/decryption.

AES Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • aes-cbc
  • aes-cfb
  • aes-ctr
  • aes-ecb
  • aes-ofb
  • aes-gcm

DES Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • des-cbc
  • des-cfb
  • des-ctr
  • des-ecb
  • des-ofb

3DES Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • 3des-cbc
  • 3des-cfb
  • 3des-ctr
  • 3des-ecb
  • 3des-ofb

Twofish Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • Twofish-cbc
  • Twofish-cfb
  • Twofish-ctr
  • Twofish-ecb
  • Twofish-ofb

Blowfish Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • Blowfish-cbc
  • Blowfish-cfb
  • Blowfish-ctr
  • Blowfish-ecb
  • Blowfish-ofb

  • SM3 Hash

SM4 Encryption/Decryption with secret key, iv and padding(ZERO / ANSI X.923/ ISO/IEC 9797-1 / ISO 10126 / PKCS5 / PKCS7).

  • SM4-cbc
  • SM4-cfb
  • SM4-ofb
  • SM4-ctr
  • SM4-ccm
  • SM4-gcm

Asymmetric encryption/decryption with public key and private key.

  • rsa
  • ecc

Documentation

See documentaion and examples.

Staying up to date

To update crypto-go to the latest version, use go get -u github.com/trumanwong/cryptogo

Acknowledgements

License

This project is licensed under the terms of the MIT license.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCBCDecrypt Aes CBC decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("Acdkp3UqE2Gp7BDkzhQIuQ==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := AesCBCDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func AesCBCEncrypt

func AesCBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCBCEncrypt Aes CBC encryption with key, iv and padding

Example
encrypt, err := AesCBCEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS5)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

Acdkp3UqE2Gp7BDkzhQIuQ==

func AesCFBDecrypt

func AesCFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCFBDecrypt Aes CFB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("Od5pO4YprY9UqIxokeQo4A==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := AesCFBDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func AesCFBEncrypt

func AesCFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCFBEncrypt Aes CFB encryption with key, iv and padding

Example
encrypt, err := AesCFBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

Od5pO4YprY9UqIxokeQo4A==

func AesCTRDecrypt

func AesCTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCTRDecrypt Aes CTR decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("Od5pO4YprY9UqIxokeQo4A==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := AesCTRDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func AesCTREncrypt

func AesCTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesCTREncrypt Aes CTR encryption with key, iv and padding

Example
encrypt, err := AesCTREncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

Od5pO4YprY9UqIxokeQo4A==

func AesECBDecrypt

func AesECBDecrypt(src, key []byte, padding paddings.CipherPadding) ([]byte, error)

AesECBDecrypt Aes ECB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("G4q6Xt8NyBS9Gi2rfgdleA==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := AesECBDecrypt(src, []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func AesECBEncrypt

func AesECBEncrypt(clearText, key []byte, padding paddings.CipherPadding) ([]byte, error)

AesECBEncrypt Aes ECB encryption with key, iv and padding

Example
encrypt, err := AesECBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

G4q6Xt8NyBS9Gi2rfgdleA==

func AesGCMDecrypt

func AesGCMDecrypt(src, key, nonce []byte, padding paddings.CipherPadding) ([]byte, error)
Example
key := []byte("1234567812345678")
nonce, _ := base64.StdEncoding.DecodeString("DopH/Gbb77Rb1aKo")

password, _ := base64.StdEncoding.DecodeString("4bjjnHQiqaZJCUurnVk7s1pO7Y4+5rOX6p/s9ss/Jv0=")
ret, err := AesGCMDecrypt(password, key, nonce, paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(ret))
Output:

TrumanWong

func AesGCMEncrypt

func AesGCMEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesGCMEncrypt Aes GCM encryption with key

Example
clearText := []byte("TrumanWong")
key := []byte("1234567812345678")
nonce, _ := base64.StdEncoding.DecodeString("DopH/Gbb77Rb1aKo")

password, err := AesGCMEncrypt(clearText, key, nonce, paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

4bjjnHQiqaZJCUurnVk7s1pO7Y4+5rOX6p/s9ss/Jv0=

func AesOFBDecrypt

func AesOFBDecrypt(src, key, nonce []byte, padding paddings.CipherPadding) ([]byte, error)

AesOFBDecrypt Aes OFB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("Od5pO4YprY9UqIxokeQo4A==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := AesOFBDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func AesOFBEncrypt

func AesOFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

AesOFBEncrypt Aes OFB encryption with key, iv and padding

Example
encrypt, err := AesOFBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

Od5pO4YprY9UqIxokeQo4A==

func Base64Decode

func Base64Decode(src []byte) ([]byte, error)

Base64Decode base64 decode

Example
decode, err := Base64Decode([]byte("VHJ1bWFuV29uZw=="))
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decode))
Output:

TrumanWong

func Base64Encode

func Base64Encode(src []byte) []byte

Base64Encode base64 encode

Example
encode := Base64Encode([]byte("TrumanWong"))
fmt.Println(string(encode))
Output:

VHJ1bWFuV29uZw==

func BlowfishCBCDecrypt

func BlowfishCBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCBCDecrypt Blowfish CBC decryption with key, iv and padding

Example
encrypt, err := base64.StdEncoding.DecodeString("9EOZcxBiUN1RF9MIP4DFyA==")
if err != nil {
	fmt.Println(err)
	return
}
decrypt, err := BlowfishCBCDecrypt(encrypt, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decrypt))
Output:

TrumanWong

func BlowfishCBCEncrypt

func BlowfishCBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCBCEncrypt Blowfish CBC encryption with key, iv and padding

Example
encrypt, err := BlowfishCBCEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

9EOZcxBiUN1RF9MIP4DFyA==

func BlowfishCFBDecrypt

func BlowfishCFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCFBDecrypt Blowfish CFB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("QM6mpzZJDT2mBu4k1NdGPA==")
if err != nil {
	fmt.Println(err)
	return
}
decrypt, err := BlowfishCFBDecrypt(src, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decrypt))
Output:

TrumanWong

func BlowfishCFBEncrypt

func BlowfishCFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCFBEncrypt Blowfish CFB encryption with key, iv and padding

Example
encrypt, err := BlowfishCFBEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

QM6mpzZJDT2mBu4k1NdGPA==

func BlowfishCTRDecrypt

func BlowfishCTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCTRDecrypt Blowfish CTR decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("QM6mpzZJDT27xwEkDxgIGQ==")
if err != nil {
	fmt.Println(err)
	return
}
decrypt, err := BlowfishCTRDecrypt(src, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decrypt))
Output:

TrumanWong

func BlowfishCTREncrypt

func BlowfishCTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishCTREncrypt Blowfish CTR encryption with key, iv and padding

Example
encrypt, err := BlowfishCTREncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

QM6mpzZJDT27xwEkDxgIGQ==

func BlowfishECBDecrypt

func BlowfishECBDecrypt(src, key []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishECBDecrypt Blowfish ECB decryption with key and padding

Example
encrypt, err := base64.StdEncoding.DecodeString("oCuapqeOZtmwqM4VwEXz2w==")
if err != nil {
	fmt.Println(err)
	return
}
decrypt, err := BlowfishECBDecrypt(encrypt, []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decrypt))
Output:

TrumanWong

func BlowfishECBEncrypt

func BlowfishECBEncrypt(clearText, key []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishECBEncrypt Blowfish ECB encryption with key and padding

Example
encrypt, err := BlowfishECBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

oCuapqeOZtmwqM4VwEXz2w==

func BlowfishOFBDecrypt

func BlowfishOFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishOFBDecrypt Blowfish OFB decryption with key, iv and padding

Example
encrypt, err := base64.StdEncoding.DecodeString("QM6mpzZJDT3SLilrXziq/Q==")
if err != nil {
	fmt.Println(err)
	return
}
decrypt, err := BlowfishOFBDecrypt(encrypt, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(decrypt))
Output:

TrumanWong

func BlowfishOFBEncrypt

func BlowfishOFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

BlowfishOFBEncrypt Blowfish OFB encryption with key, iv and padding

Example
encrypt, err := BlowfishOFBEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

QM6mpzZJDT3SLilrXziq/Q==

func DesCBCDecrypt

func DesCBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCBCDecrypt decrypts by des with cbc mode.

Example
src, err := base64.StdEncoding.DecodeString("DQ3gRwc3eKO/ffcphCq45g==")
password, err := DesCBCDecrypt(src, []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func DesCBCEncrypt

func DesCBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCBCEncrypt encrypts by des with cbc mode.

Example
password, err := DesCBCEncrypt([]byte("TrumanWong"), []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

DQ3gRwc3eKO/ffcphCq45g==

func DesCFBDecrypt

func DesCFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCFBDecrypt decrypts by des with cfb mode.

Example
src, err := base64.StdEncoding.DecodeString("wqJ35Rm72+aM4xRnW2SKzw==")
password, err := DesCFBDecrypt(src, []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func DesCFBEncrypt

func DesCFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCFBEncrypt encrypts by des with cfb mode.

Example
password, err := DesCFBEncrypt([]byte("TrumanWong"), []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

wqJ35Rm72+aM4xRnW2SKzw==

func DesCTRDecrypt

func DesCTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCTRDecrypt decrypts by des with ctr mode.

Example
password, err := base64.StdEncoding.DecodeString("wqJ35Rm72+Yvde8W2Xn2CA==")
if err != nil {
	fmt.Println(err)
	return
}
clearText, err := DesCTRDecrypt(password, []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(clearText))
Output:

TrumanWong

func DesCTREncrypt

func DesCTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesCTREncrypt encrypts by des with ctr mode.

Example
password, err := DesCTREncrypt([]byte("TrumanWong"), []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

wqJ35Rm72+Yvde8W2Xn2CA==

func DesECBDecrypt

func DesECBDecrypt(src, key []byte, padding paddings.CipherPadding) ([]byte, error)

DesECBDecrypt decrypts by des with ecb mode.

Example
password, err := base64.StdEncoding.DecodeString("rayjMG0QXSYRXd2HJ0J4rg==")
if err != nil {
	fmt.Println(err)
	return
}
clearText, err := DesECBDecrypt(password, []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(clearText))
Output:

TrumanWong

func DesECBEncrypt

func DesECBEncrypt(clearText, key []byte, padding paddings.CipherPadding) ([]byte, error)

DesECBEncrypt encrypts by des with ecb mode.

Example
password, err := DesECBEncrypt([]byte("TrumanWong"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

rayjMG0QXSYRXd2HJ0J4rg==

func DesOFBDecrypt

func DesOFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesOFBDecrypt decrypts by des with ofb mode.

Example
password, err := base64.StdEncoding.DecodeString("wqJ35Rm72+aHEpjfKW8Sqg==")
if err != nil {
	fmt.Println(err)
	return
}
clearText, err := DesOFBDecrypt(password, []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(clearText))
Output:

TrumanWong

func DesOFBEncrypt

func DesOFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

DesOFBEncrypt encrypts by des with ofb mode.

Example
password, err := DesOFBEncrypt([]byte("TrumanWong"), []byte("12345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

wqJ35Rm72+aHEpjfKW8Sqg==

func HexDecode

func HexDecode(src []byte) ([]byte, error)

HexDecode hex decode

Example
decrypt, err := HexDecode([]byte("48656c6c6f20576f726c64"))
if err != nil {
	panic(err)
}
fmt.Println(string(decrypt))
Output:

Hello World

func HexEncode

func HexEncode(src []byte) []byte

HexEncode hex encode

Example
encrypt := HexEncode([]byte("Hello World"))
fmt.Println(string(encrypt))
Output:

48656c6c6f20576f726c64

func HmacMD5

func HmacMD5(key, clearText []byte) string

HmacMD5 Keyed-hash message authentication codes (HMAC) is a mechanism for message authentication using cryptographic hash functions.

Example
fmt.Println(HmacMD5([]byte("TrumanWong"), []byte("123")))
Output:

1a152759b05a1cc0e2841a7fb58a559b

func HmacRIPEMD160

func HmacRIPEMD160(key, clearText string) string

HmacRIPEMD160 returns a hexadecimal encoding of ripemd160 encrypted string

Example
fmt.Println(HmacRIPEMD160("", "TrumanWong"))
Output:

a4c9440f8cce286e42b959468a048c2dd7bfa8b0

func HmacSHA1

func HmacSHA1(key, clearText string) string

HmacSHA1 returns a hexadecimal encoding of sha1 encrypted string

Example
fmt.Println(HmacSHA1("", "TrumanWong"))
Output:

95a8c2db5b6ec69c234414411abc429cde8ab081

func HmacSHA224

func HmacSHA224(key, clearText string) string

HmacSHA224 returns a hexadecimal encoding of sha-224 encrypted string

Example
fmt.Println(HmacSHA224("", "TrumanWong"))
Output:

9f7603cf61594456d90d89984676d56baac1eb8b09e2941f49709885

func HmacSHA256

func HmacSHA256(key, clearText string) string

HmacSHA256 returns a hexadecimal encoding of sha256 encrypted string

Example
fmt.Println(HmacSHA256("", "TrumanWong"))
Output:

e8d589fc8a14f7f24a7b2a50412dad4f7f9d662e6cb6690ef2e68377f7494f9f

func HmacSHA3224

func HmacSHA3224(key, clearText string) string

HmacSHA3224 returns a hexadecimal encoding of sha3-224 encrypted string

Example
fmt.Println(HmacSHA3224("", "TrumanWong"))
Output:

7ae1b1fdceebaaa89836a08909cdc310eaf25a5e7a8cf24bd0db962f

func HmacSHA3256

func HmacSHA3256(key, clearText string) string

HmacSHA3256 returns a hexadecimal encoding of sha3-256 encrypted string

Example
fmt.Println(HmacSHA3256("", "TrumanWong"))
Output:

fcdca5772280608a449743000c671cb34a68dcd25817ea90dc01cd9b32d26d17

func HmacSHA3384

func HmacSHA3384(key, clearText string) string

HmacSHA3384 returns a hexadecimal encoding of sha3-384 encrypted string

Example
fmt.Println(HmacSHA3384("", "TrumanWong"))
Output:

768313de1e3b6e600ad1ec89fc937222d3b074a6a3ce936c1354ab6bb2f4f60a475cb33cbdae65c68a8ddc1cf1b9f46a

func HmacSHA3512

func HmacSHA3512(key, clearText string) string

HmacSHA3512 returns a hexadecimal encoding of sha3-512 encrypted string

Example
fmt.Println(HmacSHA3512("", "TrumanWong"))
Output:

c72a7f76f69088c775aa602791ec6488cf9c9e062bded80e168b1320394f2a0fa406d8c07f5303c2055879b69a3e4cbfa50f3b3b1fa2b85c10b24c2e4daa402e

func HmacSHA384

func HmacSHA384(key, clearText string) string

HmacSHA384 returns a hexadecimal encoding of sha384 encrypted string

Example
fmt.Println(HmacSHA384("", "TrumanWong"))
Output:

b9da6d3260e34c71b548925261a731458f4dd1dcaf994deec2356538188fa5cc9410a3e51970423660804ad9d4f8574d

func HmacSHA512

func HmacSHA512(key, clearText string) string

HmacSHA512 returns a hexadecimal encoding of sha512 encrypted string

Example
fmt.Println(HmacSHA512("", "TrumanWong"))
Output:

8cd5a8cbdc537604c1ac0e72d7cee562f38c166b471e85e76fe6c2632e0e18c1f6720eaad0134541d23da8aa2356b82cc86aedc868fc119760dd97781795481d

func MD5

func MD5(clearText []byte) string

MD5 return md5 encrypted string

Example
fmt.Println(MD5([]byte("123")))
Output:

202cb962ac59075b964b07152d234b70

func MD5Sixteen

func MD5Sixteen(clearText []byte) string

MD5Sixteen Returns a 16-bit MD5 encrypted string

Example
fmt.Println(MD5Sixteen([]byte("123")))
Output:

ac59075b964b0715

func MD5SixteenToLower

func MD5SixteenToLower(clearText []byte) string

MD5SixteenToLower Returns a 16-digit uppercase MD5 encrypted string

Example
fmt.Println(MD5SixteenToLower([]byte("123")))
Output:

ac59075b964b0715

func MD5SixteenToUpper

func MD5SixteenToUpper(clearText []byte) string

MD5SixteenToUpper Returns a 16-digit uppercase MD5 encrypted string

Example
fmt.Println(MD5SixteenToUpper([]byte("123")))
Output:

AC59075B964B0715

func MD5ToLower

func MD5ToLower(clearText []byte) string

MD5ToLower Return MD5 lowercase encrypted string

Example
fmt.Println(MD5ToLower([]byte("123")))
Output:

202cb962ac59075b964b07152d234b70

func MD5ToUpper

func MD5ToUpper(clearText []byte) string

MD5ToUpper Return MD5 uppercase encrypted string

Example
fmt.Println(MD5ToUpper([]byte("123")))
Output:

202CB962AC59075B964B07152D234B70

func MorseDecode added in v1.0.5

func MorseDecode(src []byte, separator string) (dst string, err error)
Example
decode, err := MorseDecode([]byte("-|.-.|..-|--|.-|-.|.--|---|-.|--."), "|")
if err != nil {
	return
}
fmt.Println(decode)
Output:

trumanwong

func MorseEncode added in v1.0.5

func MorseEncode(input []byte, separator string) (dst string, err error)
Example
encode, err := MorseEncode([]byte("TrumanWong"), "|")
if err != nil {
	return
}
fmt.Println(encode)
Output:

-|.-.|..-|--|.-|-.|.--|---|-.|--.

func PasswordHash

func PasswordHash(clearText []byte, cost int) ([]byte, error)

PasswordHash returns the bcrypt hash of the password at the given cost. PasswordHash does not accept passwords longer than 72 bytes

Example
password, err := PasswordHash([]byte("TrumanWong"), bcrypt.DefaultCost)
if err != nil {
	fmt.Println(err)
	return
}

fmt.Println(PasswordVerify([]byte("TrumanWong"), password))
Output:

true

func PasswordVerify

func PasswordVerify(clearText, hashedPassword []byte) bool

PasswordVerify compares a bcrypt hashed password with its possible plaintext equivalent. Returns nil on success, or an error on failure.

func RC4Decrypt

func RC4Decrypt(key, password string) ([]byte, error)
Example
decrypt, err := RC4Decrypt("TrumanWong", "b7795a2b70d9f7f80ef875")
if err != nil {
	return
}
fmt.Println(string(decrypt))
Output:

Hello World

func RC4Encrypt

func RC4Encrypt(key, clearText string) ([]byte, error)

RC4Encrypt RC4 encryption. key: RC4 key clearText: plaintext password

Example
encrypt, err := RC4Encrypt("TrumanWong", "Hello World")
if err != nil {
	return
}
fmt.Println(string(encrypt))
Output:

b7795a2b70d9f7f80ef875

func RIPEMD160

func RIPEMD160(clearText string) string

RIPEMD160 return ripemd160 encrypted string

Example
fmt.Println(RIPEMD160("TrumanWong"))
Output:

577d5d4c78049fcfeeeb4674bc4bd5c8e55ef3bf

func SHA1

func SHA1(clearText string) string

SHA1 return sha1 encrypted string

Example
fmt.Println(SHA1("TrumanWong"))
Output:

b26f1810bfa1cf2df0d7b76f7325d35a9b5540e8

func SHA224

func SHA224(clearText string) string

SHA224 SHA-224 is a variant of SHA-2 that produces a 224-bit digest.

Example
fmt.Println(SHA224("TrumanWong"))
Output:

d1de0e837d09504b7389e5bd5a8336955cc795f1ec134cea5124ef0c

func SHA256

func SHA256(clearText string) string

SHA256 return sha256 encrypted string

Example
fmt.Println(SHA256("TrumanWong"))
Output:

0563f622897657ea42da10bd2c64a08573f7213c99e645623cacf9edc04b238f

func SHA3224

func SHA3224(clearText string) string

SHA3224 SHA3-224 is a variant of SHA3 that produces a 224-bit digest.

Example
fmt.Println(SHA3224("TrumanWong"))
Output:

a2bf53fa37f1e9bba362f9578ed112b7f6393c90647a7f14795c17fe

func SHA3256

func SHA3256(clearText string) string

SHA3256 SHA3-256 is a variant of SHA3 that produces a 256-bit digest.

Example
fmt.Println(SHA3256("TrumanWong"))
Output:

8c8d0e5a5c5b5e5e5f5f606061616162626263636464656566666767

func SHA3384

func SHA3384(clearText string) string

SHA3384 SHA3-384 is a variant of SHA3 that produces a 384-bit digest.

Example
fmt.Println(SHA3384("TrumanWong"))
Output:

397dd7085c0e5bce21bbd3da653289b579a145ecfde207f1e12f39cf2c843d5137f25492c78215afe166463b5a9e3e22

func SHA3512

func SHA3512(clearText string) string

SHA3512 SHA3-512 is a variant of SHA3 that produces a 512-bit digest.

Example
fmt.Println(SHA3512("TrumanWong"))
Output:

de917c20f3dbdc0299acbb61b2e0a0f62386af0a2458eb17c61469ab389773ae63a0f88e0596e2801246d2697c1212152c9e9f5839d93e03ad4b18b6a1353767

func SHA384

func SHA384(clearText string) string

SHA384 return sha384 encrypted string

Example
fmt.Println(SHA384("TrumanWong"))
Output:

9bc8b8e00f51df7c8b00bd5f04a71ab397060a4327283e620883572aa0e0e4f6b468384ab35dbe1a1d380b8b1b221bc3

func SHA512

func SHA512(clearText string) string

SHA512 return sha512 encrypted string

Example
fmt.Println(SHA512("TrumanWong"))
Output:

e450d416e9d4bd2a3260d6c0a96156946bcc6fe37cf1a60c7e535281babaa598b9bae5a81d170da2ea9acc0f69feb39c958c0e7304a459c9c57d58294e9ad63e

func Sm3 added in v1.0.5

func Sm3(clearText []byte) string

Sm3 encrypts by sm3.

Example
fmt.Println(Sm3([]byte("TrumanWong")))
Output:

ad878f7dac4141200b516abd9fc2d1bf238e6d6df9a98b9c959569515ef5c6b9

func Sm4CBCDecrypt added in v1.0.5

func Sm4CBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CBCDecrypt Sm4 CBC decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("6pWZk9lLpz4vFgzByqP+Sg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4CBCDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4CBCEncrypt added in v1.0.5

func Sm4CBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CBCEncrypt Sm4 CBC encryption with key, iv and padding

Example
encrypt, err := Sm4CBCEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

6pWZk9lLpz4vFgzByqP+Sg==

func Sm4CCMDecrypt added in v1.0.5

func Sm4CCMDecrypt(src, key, nonce []byte) ([]byte, error)

Sm4CCMDecrypt Sm4 CCM decryption with key, nonce and padding

Example
nonce, _ := base64.StdEncoding.DecodeString("OChmI6qkGVC16qbY")
src, err := base64.StdEncoding.DecodeString("7sZG+aVsUQiK75ZZOfNkyJ4H4cihvssY9U0=")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4CCMDecrypt(src, []byte("1234567812345678"), nonce)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4CCMEncrypt added in v1.0.5

func Sm4CCMEncrypt(clearText, key, nonce []byte) ([]byte, error)

Sm4CCMEncrypt Sm4 CCM encryption with key, nonce and padding

Example
nonce, _ := base64.StdEncoding.DecodeString("OChmI6qkGVC16qbY")
encrypt, err := Sm4CCMEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), nonce)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

7sZG+aVsUQiK75ZZOfNkyJ4H4cihvssY9U0=

func Sm4CFBDecrypt added in v1.0.5

func Sm4CFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CFBDecrypt Sm4 CFB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("vBEQQjHDCbaSpz60W+0BFg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4CFBDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4CFBEncrypt added in v1.0.5

func Sm4CFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CFBEncrypt Sm4 CFB encryption with key, iv and padding

Example
encrypt, err := Sm4CFBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

vBEQQjHDCbaSpz60W+0BFg==

func Sm4CTRDecrypt added in v1.0.5

func Sm4CTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CTRDecrypt Sm4 CTR decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("vBEQQjHDCbaSpz60W+0BFg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4CTRDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4CTREncrypt added in v1.0.5

func Sm4CTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4CTREncrypt Sm4 CTR encryption with key, iv and padding

Example
encrypt, err := Sm4CTREncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

vBEQQjHDCbaSpz60W+0BFg==

func Sm4GCMDecrypt added in v1.0.5

func Sm4GCMDecrypt(src, key, nonce []byte) ([]byte, error)
Example
nonce, _ := base64.StdEncoding.DecodeString("OChmI6qkGVC16qbY")
src, err := base64.StdEncoding.DecodeString("sMbUUdfBMAyIql9gNOIX0uKEiPPo3OwyiaI=")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4GCMDecrypt(src, []byte("1234567812345678"), nonce)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4GCMEncrypt added in v1.0.5

func Sm4GCMEncrypt(clearText, key, nonce []byte) ([]byte, error)
Example
nonce, _ := base64.StdEncoding.DecodeString("OChmI6qkGVC16qbY")
encrypt, err := Sm4GCMEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), nonce)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

sMbUUdfBMAyIql9gNOIX0uKEiPPo3OwyiaI=

func Sm4OFBDecrypt added in v1.0.5

func Sm4OFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4OFBDecrypt Sm4 OFB decryption with key, iv and padding

Example
src, err := base64.StdEncoding.DecodeString("vBEQQjHDCbaSpz60W+0BFg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := Sm4OFBDecrypt(src, []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func Sm4OFBEncrypt added in v1.0.5

func Sm4OFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

Sm4OFBEncrypt Sm4 OFB encryption with key, iv and padding

Example
encrypt, err := Sm4OFBEncrypt([]byte("TrumanWong"), []byte("1234567812345678"), []byte("1234567812345678"), paddings.PKCS7)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(encrypt))
Output:

vBEQQjHDCbaSpz60W+0BFg==

func TripleDesCBCDecrypt

func TripleDesCBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCBCDecrypt decrypts by 3des with cbc mode.

Example
src, err := base64.StdEncoding.DecodeString("DQ3gRwc3eKO/ffcphCq45g==")
if err != nil {
	fmt.Println(err)
	return
}

iv := []byte("12345678")

// Triple-Des-CBC Zero padding
key := []byte("123456781234567812345678")
dst, err := TripleDesCBCDecrypt(src, key, iv, paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(dst))
Output:

TrumanWong

func TripleDesCBCEncrypt

func TripleDesCBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCBCEncrypt encrypts by 3des with cbc mode.

Example
cipherText, err := TripleDesCBCEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(cipherText))
Output:

DQ3gRwc3eKO/ffcphCq45g==

func TripleDesCFBDecrypt

func TripleDesCFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCFBDecrypt decrypts by 3des with cfb mode.

Example
src, err := base64.StdEncoding.DecodeString("wqJ35Rm72+aM4xRnW2SKzw==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := TripleDesCFBDecrypt(src, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func TripleDesCFBEncrypt

func TripleDesCFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCFBEncrypt encrypts by 3des with cfb mode.

Example
cipherText, err := TripleDesCFBEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(cipherText))
Output:

wqJ35Rm72+aM4xRnW2SKzw==

func TripleDesCTRDecrypt

func TripleDesCTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCTRDecrypt decrypts by 3des with ctr mode.

Example
cipherText, err := base64.StdEncoding.DecodeString("wqJ35Rm72+Yvde8W2Xn2CA==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := TripleDesCTRDecrypt(cipherText, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func TripleDesCTREncrypt

func TripleDesCTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesCTREncrypt encrypts by 3des with ctr mode.

Example
cipherText, err := TripleDesCTREncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(cipherText))
Output:

wqJ35Rm72+Yvde8W2Xn2CA==

func TripleDesECBDecrypt

func TripleDesECBDecrypt(src, key []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesECBDecrypt decrypts by 3des with ecb mode.

Example
cipherText, err := base64.StdEncoding.DecodeString("rayjMG0QXSYRXd2HJ0J4rg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := TripleDesECBDecrypt(cipherText, []byte("123456781234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func TripleDesECBEncrypt

func TripleDesECBEncrypt(clearText, key []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesECBEncrypt encrypts by 3des with ecb mode.

Example
password, err := TripleDesECBEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(password))
Output:

rayjMG0QXSYRXd2HJ0J4rg==

func TripleDesOFBDecrypt

func TripleDesOFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesOFBDecrypt decrypts by 3des with ofb mode.

Example
src, err := base64.StdEncoding.DecodeString("wqJ35Rm72+aHEpjfKW8Sqg==")
if err != nil {
	fmt.Println(err)
	return
}
password, err := TripleDesOFBDecrypt(src, []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(string(password))
Output:

TrumanWong

func TripleDesOFBEncrypt

func TripleDesOFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TripleDesOFBEncrypt encrypts by 3des with ofb mode.

Example
cipherText, err := TripleDesOFBEncrypt([]byte("TrumanWong"), []byte("123456781234567812345678"), []byte("12345678"), paddings.Zero)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(base64.StdEncoding.EncodeToString(cipherText))
Output:

wqJ35Rm72+aHEpjfKW8Sqg==

func TwofishCBCDecrypt

func TwofishCBCDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCBCDecrypt Twofish CBC decryption with key, iv and padding

func TwofishCBCEncrypt

func TwofishCBCEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCBCEncrypt Twofish CBC encryption with key, iv and padding

func TwofishCFBDecrypt

func TwofishCFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCFBDecrypt Twofish CFB decryption with key, iv and padding

func TwofishCFBEncrypt

func TwofishCFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCFBEncrypt Twofish CFB encryption with key, iv and padding

func TwofishCTRDecrypt

func TwofishCTRDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCTRDecrypt Twofish CTR decryption with key, iv and padding

func TwofishCTREncrypt

func TwofishCTREncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishCTREncrypt Twofish CTR encryption with key, iv and padding

func TwofishECBDecrypt

func TwofishECBDecrypt(src, key []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishECBDecrypt Twofish ECB decryption with key and padding

func TwofishECBEncrypt

func TwofishECBEncrypt(clearText, key []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishECBEncrypt Twofish ECB encryption with key and padding

func TwofishOFBDecrypt

func TwofishOFBDecrypt(src, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishOFBDecrypt Twofish OFB decryption with key, iv and padding

func TwofishOFBEncrypt

func TwofishOFBEncrypt(clearText, key, iv []byte, padding paddings.CipherPadding) ([]byte, error)

TwofishOFBEncrypt Twofish OFB encryption with key, iv and padding

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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