crypto

package module
v0.0.0-...-c663419 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 13 Imported by: 0

README

Crypto

Diversos modos de criptografia para GoLang

Installation

To install try package, you need to install Go and set your Go workspace first.

  1. Download and install it:
$ go get -u github.com/c019/crypto
  1. Import it in your code:
import "github.com/c019/crypto"

API examples:

package main

import (
	"github.com/c019/crypto"
)

func main() {
	sha256 := crypto.Sha256{
		Texto: "c019.com.br",
	}

	fmt.Println(sha256.Encrypt())
}

OBS: Caso queria gerar os arquivos SSL para utilização da criptografia RSA

openssl req -new -x509 -sha256 -newkey rsa:2048 -nodes -keyout modelo.key.pem -out modelo.cert.pem -subj "/C=BR/ST=PR/O=Modelo"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAesIV

func GenerateAesIV() (string, error)

GenerateAesIV - Gerar um IV para o AES

Types

type AesCBC

type AesCBC aesBase

AesCBC - ...

func (*AesCBC) Decrypt

func (a *AesCBC) Decrypt() (string, error)

Decrypt - ...

func (*AesCBC) Encrypt

func (a *AesCBC) Encrypt() (string, error)

Encrypt - ...

type AesCFB

type AesCFB aesBase

AesCFB - ...

func (*AesCFB) Decrypt

func (a *AesCFB) Decrypt() (string, error)

Decrypt - ...

func (*AesCFB) Encrypt

func (a *AesCFB) Encrypt() (string, error)

Encrypt - ...

type AesCTR

type AesCTR aesBase

AesCTR - ...

func (*AesCTR) Decrypt

func (a *AesCTR) Decrypt() (string, error)

Decrypt - ...

func (*AesCTR) Encrypt

func (a *AesCTR) Encrypt() (string, error)

Encrypt - ...

type AesGCM

type AesGCM aesBase

AesGCM - ...

func (*AesGCM) Decrypt

func (a *AesGCM) Decrypt() (string, error)

Decrypt - ...

func (*AesGCM) Encrypt

func (a *AesGCM) Encrypt() (string, error)

Encrypt - ...

type AesOFB

type AesOFB aesBase

AesOFB - ...

func (*AesOFB) Decrypt

func (a *AesOFB) Decrypt() (string, error)

Decrypt - ...

func (*AesOFB) Encrypt

func (a *AesOFB) Encrypt() (string, error)

Encrypt - ...

type RsaOAEP

type RsaOAEP struct {
	Texto          string
	Label          []byte
	PathPrivateKey string
	PathPublicKey  string
}

RsaOAEP - ...

func (*RsaOAEP) Decrypt

func (r *RsaOAEP) Decrypt() (string, error)

Decrypt - Encriptar

func (*RsaOAEP) Encrypt

func (r *RsaOAEP) Encrypt() (string, error)

Encrypt - Encriptar

type Sha256

type Sha256 struct {
	Texto string
	Hash  string
}

Sha256 - ...

func (*Sha256) Encrypt

func (s *Sha256) Encrypt() string

Encrypt - Funcao para criptografar utilizando o SHA256

type Sha512

type Sha512 struct {
	Texto string
	Hash  string
}

Sha512 - ...

func (*Sha512) Encrypt

func (s *Sha512) Encrypt() string

Encrypt - Funcao para criptografar utilizando o SHA512

Jump to

Keyboard shortcuts

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