Encryption & Decryption package for golang

Related tags

Cryptography encdec
Overview

encdec

Encryption & Decryption package for golang

func main() {

startingTime := time.Now()

privKey, pubKey := GenerateRsaKeyPair()
fmt.Println("PrivateKey:", privKey)
pkey := ExportRsaPrivateKeyAsPemStr(privKey)

privKey.Precompute()
err := privKey.Validate()
if err != nil {
	fmt.Println("Error:", err.Error())
	os.Exit(1)
}

fmt.Println("Key-1:", pkey)
fmt.Println("-----------------")

pkey2, err := ParseRsaPrivateKeyFromPemStr(pkey)
fmt.Println(err, "Key-2:", pkey2)

pubKeystr, _ := ExportRsaPublicKeyAsPemStr(pubKey)

pubKey2, err := ParseRsaPublicKeyFromPemStr(pubKeystr)

fmt.Println("PublicKey:", pubKeystr, err)

fmt.Println(pubKey, err)
fmt.Println("*************************")
fmt.Println(pubKey2)

var label []byte
sourceText := []byte(`I Love my country`)
encryptedText := encrypt(pubKey, sourceText, label)
fmt.Println("encryptedText:", encryptedText)

fmt.Println("#################")
fmt.Println("sourceText...:", sourceText)
decryptedText := decrypt(pkey2, encryptedText, label)
fmt.Println("decryptedText:", decryptedText)

fmt.Println("TimeTaken:", time.Since(startingTime).Milliseconds(), " ms")

}

Owner
MD MOSTAIN BILLAH
Highly motivated full stack developer
MD MOSTAIN BILLAH
Go Encrypt! Is a simple command-line encryption and decryption application using AES-256 GCM.

Go Encrypt! Go Encrypt! is a command-line application used to easily encrypt and decrypt files with the AES-256 GCM encryption algorithm. Usage Usage

Peter Georgas 0 Jan 5, 2022
The minilock file encryption system, ported to pure Golang. Includes CLI utilities.

Go-miniLock A pure-Go reimplementation of the miniLock asymmetric encryption system. by Cathal Garvey, Copyright Oct. 2015, proudly licensed under the

Cathal Garvey 173 May 11, 2021
An easy-to-use XChaCha20-encryption wrapper for io.ReadWriteCloser (even lossy UDP) using ECDH key exchange algorithm, ED25519 signatures and Blake3+Poly1305 checksums/message-authentication for Go (golang). Also a multiplexer.

Quick start Prepare keys (on both sides): [ -f ~/.ssh/id_ed25519 ] && [ -f ~/.ssh/id_ed25519.pub ] || ssh-keygen -t ed25519 scp ~/.ssh/id_ed25519.pub

null 22 Dec 22, 2021
DERO Homomorphic Encryption Blockchain Protocol

Homomorphic encryption is a form of encryption allowing one to perform calculations on encrypted data without decrypting it first. The result of the computation is in an encrypted form, when decrypted the output is the same as if the operations had been performed on the unencrypted data.

null 47 Jan 13, 2022
Sekura is an Encryption tool that's heavily inspired by the Rubberhose file system.

It allows for multiple, independent file systems on a single disk whose existence can only be verified if you posses the correct password.

null 49 Nov 18, 2021
A document encryption solution for the reMarkable 2 ePaper tablet.

Remarkable 2 Encryption This repository contains multiple tools to encrypt the home folder of the reMarkable 2 epaper tablet using gocryptfs. Detailed

RedTeam Pentesting GmbH 22 Nov 11, 2021
A super easy file encryption utility written in go and under 800kb

filecrypt A super easy to use file encryption utility written in golang ⚠ Help Wanted on porting filecrypt to other programing languages NOTE: if you

Flew Software 75 Nov 5, 2021
Encryption Abstraction Layer and Utilities for ratnet

What is Bencrypt? Bencrypt is an abstraction layer for cryptosystems in Go, that lets applications use hybrid cryptosystems without being coupled to t

null 17 Dec 15, 2021
Go implementation of the Data At Rest Encryption (DARE) format.

Secure IO Go implementation of the Data At Rest Encryption (DARE) format. Introduction It is a common problem to store data securely - especially on u

Object Storage for the Era of the Hybrid Cloud 278 Jan 3, 2022
A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Filippo Valsorda 9.7k Jan 15, 2022
Easy to use encryption library for Go

encryptedbox EncryptedBox is an easy to use module for Go that can encrypt or sign any type of data. It is especially useful when you must serialize y

Jesse Swidler 18 Oct 26, 2021
A tool for secrets management, encryption as a service, and privileged access management

Deploy HCP Vault & AWS Transit Gateways via Terraform https://medium.com/hashicorp-engineering/deploying-hcp-vault-using-the-hcp-terraform-provider-5e

Temur Yunusov 0 Nov 23, 2021
TTAK.KO-12.0223 Lightweight Encryption Algorithm with Galois/Counter Mode (LEA-GCM)

LEACrypt The Lightweight Encryption Algorithm (also known as LEA) is a 128-bit block cipher developed by South Korea in 2013 to provide confidentialit

Pedro F. Albanese 0 Dec 28, 2021
Functional encryption for images

ImageFE Functional encryption for images. Introduction In the traditional cryptography framework, a decryptor either recovers the entire plaintext fro

null 2 Dec 5, 2021
Attempts to make attribute based encryption work, particularly trying out bn256 pairing curve

EC Pairings over bn256 This is an attempt to solve the core problem of attribute based encryption, where the goal is to be able to use CA-issued attri

Robert Fielding 1 Jan 5, 2022
Package pinentry provides a client to GnuPG's pinentry.

Package pinentry provides a client to GnuPG's pinentry.

Tom Payne 5 Nov 11, 2021
Package filippo.io/intermediates embeds a bundle of known unexpired, unrevoked intermediate certificates chaining to roots in the Mozilla Root Program

filippo.io/intermediates Package intermediates embeds a list of known unexpired, unrevoked intermediate certificates chaining to roots with Websites t

Filippo Valsorda 43 Jan 4, 2022
ECIES implementation forked of the `crypto/ecies` package from Ethereum

# NOTE This implementation is direct fork of Kylom's implementation. I claim no authorship over this code apart from some minor modifications. Please

Stichting Nuts 0 Dec 7, 2021
Culture - A package that gets a random name from the Culture series' ships Minds.

culture A package that gets a random name from the Culture series' ships Minds. Getting started This project requires Go to be installed. On OS X with

Shea Hartley 0 Jan 2, 2022