Giter VIP home page Giter VIP logo

golang-crypto-tls's Introduction

golang-crypto-tls

Fork of golang 1.8.1 crypto/tls to add DHE, PSK, DHE_PSK, RSA_PSK, and DH_anon ciphersuites

WARNING

Some ciphersuites that this package implements were left unimplemented in the standard golang package for a reason! Those ciphersuites should only be used if you understand why you are using them. For example:

  1. DH_anon ciphersuites provide no authentication and are vulnerable to a MITM attack.
  2. DHE ciphersuites are slower than ECDHE ciphersuites.

For your protection, every ciphersuite added in this package is not enabled by default. To use them you must explicitly name them in the CipherSuites setting in your tls.Config.

Added Ciphersuites

This package implements every standard TLS key exchange mechanism except SRP and ECDHEPSK (no one cares about FORTEZZA). If you need either of those, let me know; ECDHEPSK is simple to add, SRP less so.

The following 32 ciphersuites are added in this package:

DHE_RSA

  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
  • TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
  • TLS_DHE_RSA_WITH_AES_128_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_256_CBC_SHA
  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
  • TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256

DH_anon

  • TLS_DH_anon_WITH_AES_128_GCM_SHA256
  • TLS_DH_anon_WITH_AES_256_GCM_SHA384
  • TLS_DH_anon_WITH_AES_128_CBC_SHA
  • TLS_DH_anon_WITH_AES_256_CBC_SHA
  • TLS_DH_anon_WITH_AES_128_CBC_SHA256
  • TLS_DH_anon_WITH_AES_256_CBC_SHA256

RSA

  • TLS_RSA_WITH_AES_256_CBC_SHA256

RSA_PSK

  • TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
  • TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
  • TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
  • TLS_RSA_PSK_WITH_AES_128_CBC_SHA
  • TLS_RSA_PSK_WITH_AES_256_CBC_SHA
  • TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256

DHE_PSK

  • TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
  • TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
  • TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
  • TLS_DHE_PSK_WITH_AES_128_CBC_SHA
  • TLS_DHE_PSK_WITH_AES_256_CBC_SHA
  • TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256

PSK

  • TLS_PSK_WITH_AES_128_CBC_SHA256
  • TLS_PSK_WITH_AES_128_CBC_SHA
  • TLS_PSK_WITH_AES_256_CBC_SHA
  • TLS_PSK_WITH_AES_128_GCM_SHA256
  • TLS_PSK_WITH_AES_256_GCM_SHA384
  • TLS_PSK_WITH_CHACHA20_POLY1305_SHA256

How to use this package

Since it's a fork of a built-in package, there are a few ways to use it, none perfect. Here are the options:

Replace the default package in $GOROOT

This is the simplest option, but it requires modifying your Go installation:

  1. cd $GOROOT/src/crypto
  2. mv tls tls.bak
  3. git clone https://pathtothis/golang-crypto-tls tls

Then rebuild with go build -a

Vendor it

git clone it into a vendor/crypto/tls directory

Works great, but requires vendoring a few more packages.

Import it under an alias

import (tls "pathtothis/tls)

Downside: crypto has an internal package, so you'll need to manually duplicate that to a vendor directory.

golang-crypto-tls's People

Contributors

dreemkiller avatar mingchenzhang avatar mordyovits avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.