Simple Crypto API for Go

cryptogo

Simple cryptography API in Go

  1. Hashes:

    • hash.MD5Bytes, hash.MD5Base64, hash.MD5Hex
      calculates an MD5 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

    • hash.SHA1Bytes, hash.SHA1Base64, hash.SHA1Hex
      calculates an SHA1 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

    • hash.SHA224Bytes, hash.SHA224Base64, hash.SHA224Hex
      calculates an SHA-224 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

    • hash.SHA256Bytes, hash.SHA256Base64, hash.SHA256Hex
      calculates an SHA-256 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

    • hash.SHA384Bytes, hash.SHA384Base64, hash.SHA384Hex
      calculates an SHA-384 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

    • hash.SHA512Bytes, hash.SHA512Base64, hash.SHA512Hex
      calculates an SHA-512 chechsum of the input byte array as a byte array, base64-encoded string or hex-encoded string

  2. Password-based (PB):

    • pb.PBAesEncrypt encrypts input byte array using string password specified into a new (encrypted) byte array

    • pb.PBAesDecrypt decrypts input byte array using string password specified into a new (decrypted) byte array

    • pb.PBSignRequest signs an http request using a string password; adds 2 additional headers to the request

    • pb.PBVerifyRequest verifies previously signed http request using a string password

  3. Paddings

    • pad.PKCS7Pad adds PKCS #7 padding to an input byte array, returning new (padded) byte array

    • pad.PKCS7Unpad removes PKCS #7 padding from an input byte array, returning new (striped) byte array;
      checks if padding is correct

    • pad.X923Pad adds ANSI X.923 padding to an input byte array, returning new (padded) byte array

    • pad.X923Unad removes ANSI X.923 padding from an input byte array, returning new (striped) byte array;
      checks if padding is correct

  4. Random

    • rnd.RandomBytes generates a random byte array of the specified length

    • IV synonim for RandomBytes, used to generate random IV

    • Salt synonim for RandomBytes, used to generate random Salt

  5. Asymetric Cryptography

    • asym.GenerateKeyPair generates private/public key pair, result is returned as two strings

    • asym.Sign signes a byte array (usually hash) using private key specified

    • asym.Verify verifies a byte array signature using public key specified

Owner
Basil Gorin
IT Consultant, Solution Architect
Basil Gorin
Similar Resources

Easy to use crypto library with multiple algorithms

crypka Crypka is library, which abstracts away crypto, so one can easily do: Swap cryptosystems by swapping algorithm object in one place Easily and s

Mar 6, 2022

Coinbase - You can use this to retrieve the current price for an crypto currency

whats-this You can use this to retrieve the current price for an crypto currency

Sep 29, 2022

Crypto-project - Personal project for learning TLS

crypto-project My personal attempt to implement this cipher suite using the Go l

Feb 14, 2022

Blockcain - Trust Wallet token repository - A comprehensive, up-to-date collection of information about several thousands (!) of crypto tokens

Blockcain - Trust Wallet token repository - A comprehensive, up-to-date collection of information about several thousands (!) of crypto tokens

Trust Wallet Assets Info Overview Trust Wallet token repository is a comprehensi

Feb 14, 2022

Go-block-api - Golang implementation of Ethereum Block API

Go Ethereum Block API Golang implementation of Ethereum Block API This API can s

Jan 13, 2022

A simple ticket-wallet API. It is fully dockerized

Ticket Wallet This is a simple ticket-wallet API. It is fully dockerized. Table of contents 1 Response Data format 2 API  2.1 Get layout  2.2 Start se

Jan 23, 2022

Invoicer-chapter3 - A simple REST API that manages invoices

Securing DevOps's invoicer A simple REST API that manages invoices. This is the

Feb 17, 2022

Merchant API reference implementation

mAPI More details available in the BRFC Spec for Merchant API. The old golang (v1.1) implementation is no longer being maintained and has been moved t

Dec 14, 2022

HTTP API for a BitClout node

HTTP API for a BitClout node

BitClout is a blockchain built from the ground up to support a fully-featured social network. Its architecture is similar to Bitcoin, only it supports complex social network data like profiles, posts, follows, creator coin transactions, and more.

Dec 24, 2022
Comments
  • PB: Make Enc/Dec Parameters Configurable

    PB: Make Enc/Dec Parameters Configurable

    const PBKDF2_ITERATIONS = 1 << 15 // 32k (approx.) const PBKDF2_SALT_LENGTH = 1 << 4 // 128 bit const AES_BLOCK_LENGTH = 1 << 4 // 128 bit const AES_KEY_LENGTH = 24 // 24 bytes (192-bit) const HMAC_KEY_LENGTH = 1 << 5 // 32 bytes (256-bit)

    make these configurable (all except AES_BLOCK_LENGTH which is always 128 bit for AES)

A tiny Crypto Project with REST API

Goal ⚽ Golang으로 아무 쓸모 없는 블록체인을 한땀 한땀 만들어보면서 BTC나 ETH에 적용된 블록체인 기법 이해해보기! Special Thanks to Nico! Current... ??️ Work ?? 자세한 내용은 issue와 PR을 확인하세요. Now

Dec 30, 2021
a modern crypto messaging format

saltpack a modern crypto messaging format https://saltpack.org/ saltpack is a streamlined, modern solution, designed with simplicity in mind. It is ea

Dec 22, 2022
An easy to setup local crypto wallet based on Geth

CryptoWallet An easy to setup local crypto wallet based on Geth To run. go run CrytoWallet This will expose a set a api's. To Create new Wallet curl

Oct 15, 2021
A terminal application to watch crypto prices!
A terminal application to watch crypto prices!

cryptgo Latest Stable Version: Crytpgo is a TUI based application written purely in Go to monitor and observe cryptocurrency prices in real time! Inst

Dec 21, 2022
Real time crypto VWAP calculator
Real time crypto VWAP calculator

VWAP calculator A realtime VWAP calculator of crypto currencies. It uses coinbase as its default provider for real time data over websocket. Design Th

Oct 31, 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

Dec 7, 2021
Xk6-crypto-x509 - A k6 extension to encrypt data with a PEM Public Key

xk6-crypto-x509 A k6 extension to encrypt data with a PEM Public Key This is a k

Jan 5, 2022
InductiveDifferentiation - A Trading Experiment With The Crypto Market

A Trading Experiment With The Crypto Market The program was proposed and owned b

Apr 10, 2022