All Projects → Luzifer → Go Openssl

Luzifer / Go Openssl

Licence: apache-2.0
go-openssl is a small library wrapping the crypto/aes functions in a way the output is compatible to OpenSSL

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Openssl

Tls Channel
A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.
Stars: ✭ 113 (+85.25%)
Mutual labels:  library, openssl
Goshare
Go Share your TimeSeries/NameSpace/KeyVal DataStore (using leveldb) over HTTP &/or ZeroMQ
Stars: ✭ 59 (-3.28%)
Mutual labels:  library
Pesdk React Native Demo
React Native example for PhotoEditor SDK
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
Array view
Wrapper for references to array in C++.
Stars: ✭ 58 (-4.92%)
Mutual labels:  library
Macfinder
An iOS Library that helps you find the MAC Address of a specific IP
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
React Gojs
GoJS React integration
Stars: ✭ 59 (-3.28%)
Mutual labels:  library
Hello Bar
👋 Greet your visitors with a hello bar
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
Quantumgate
QuantumGate is a peer-to-peer (P2P) communications protocol, library and API written in C++.
Stars: ✭ 62 (+1.64%)
Mutual labels:  library
Girc
💣 girc is a flexible IRC library for Go 👌
Stars: ✭ 59 (-3.28%)
Mutual labels:  library
Lcformvalidation
Javascript based form validation library, third party library / framework agnostic.
Stars: ✭ 58 (-4.92%)
Mutual labels:  library
Thrift
Apache Thrift
Stars: ✭ 8,821 (+14360.66%)
Mutual labels:  library
Cordova Mobile Spec
Apache Cordova mobile-spec
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
Mcusim
MCUSim is an XSPICE library with microcontrollers.
Stars: ✭ 59 (-3.28%)
Mutual labels:  library
Keyboardhidemanager
Codeless manager to hide keyboard by tapping on views for iOS written in Swift
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
Vulkan2drenderer
Easy to use 2D rendering engine using Vulkan API as backend.
Stars: ✭ 60 (-1.64%)
Mutual labels:  library
Cdcontainers
Library of data containers and data structures for C programming language.
Stars: ✭ 57 (-6.56%)
Mutual labels:  library
Wolfssl
wolfSSL (formerly CyaSSL) is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3!
Stars: ✭ 1,098 (+1700%)
Mutual labels:  openssl
Cordova Plugin Device Motion
Apache Cordova Plugin device-motion
Stars: ✭ 58 (-4.92%)
Mutual labels:  library
Gena
Generic pseudo-templated containers for C. Written entirely in C89 with design inspired by the C++ STL. /// DOCS ARE SLIGHTLY OUTDATED, PROJECT IS STABLE AND STILL IN ACTIVE DEVELOPMENT
Stars: ✭ 61 (+0%)
Mutual labels:  library
New Empty Python Project Base
The Perfect Python Project Template. Bored of coding anew the same thing for your new Python projects? Here is what you need. Click below on the "use this template" green button to start using it instantly. Rename the "project" folder and all references to this folder to customize your project name.
Stars: ✭ 60 (-1.64%)
Mutual labels:  library

Go Report Card

Luzifer / go-openssl

go-openssl is a small library wrapping the crypto/aes functions in a way the output is compatible to OpenSSL / CryptoJS. For all encryption / decryption processes AES256 is used so this library will not be able to decrypt messages generated with other than openssl aes-256-cbc. If you're using CryptoJS to process the data you also need to use AES256 on that side.

Version support

For this library only the latest major version is supported. All prior major versions should no longer be used.

The versioning is following SemVer which means upgrading to a newer major version will break your code!

OpenSSL compatibility

1.1.0c

Starting with v2.0.0 go-openssl generates the encryption keys using sha256sum algorithm. This is the default introduced in OpenSSL 1.1.0c. When encrypting data you can choose which digest method to use and therefore also continue to use md5sum. When decrypting OpenSSL encrypted data md5sum, sha1sum and sha256sum are supported.

1.1.1

Starting with v4.0.0 go-openssl is capable of using the PBKDF2 key derivation method for encryption. You can choose to use it by passing the corresponding CredsGenerator.

Installation

# Get the latest version
go get github.com/Luzifer/go-openssl/v4

Usage example

The usage is quite simple as you don't need any special knowledge about OpenSSL and/or AES256:

Encrypt

import (
  "fmt"
  openssl "github.com/Luzifer/go-openssl/v4"
)

func main() {
  plaintext := "Hello World!"
  passphrase := "z4yH36a6zerhfE5427ZV"

  o := openssl.New()

  enc, err := o.EncryptBytes(passphrase, []byte(plaintext), PBKDF2SHA256)
  if err != nil {
    fmt.Printf("An error occurred: %s\n", err)
  }

  fmt.Printf("Encrypted text: %s\n", string(enc))
}

Decrypt

import (
  "fmt"
  openssl "github.com/Luzifer/go-openssl/v4"
)

func main() {
  opensslEncrypted := "U2FsdGVkX19ZM5qQJGe/d5A/4pccgH+arBGTp+QnWPU="
  passphrase := "z4yH36a6zerhfE5427ZV"

  o := openssl.New()

  dec, err := o.DecryptBytes(passphrase, []byte(opensslEncrypted), BytesToKeyMD5)
  if err != nil {
    fmt.Printf("An error occurred: %s\n", err)
  }

  fmt.Printf("Decrypted text: %s\n", string(dec))
}

Testing

To execute the tests for this library you need to be on a system having /bin/bash and openssl available as the compatibility of the output is tested directly against the openssl binary. The library itself should be usable on all operating systems supported by Go and crypto/aes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].