Perfect Forward Secrecy implement in Golang how?

1,218 views
Skip to first unread message

satos...@gmail.com

unread,
May 20, 2014, 3:56:34 PM5/20/14
to golan...@googlegroups.com
I would like to do this for my go app, does anyone have an idea on how it can be done with ListenAndServeTLS

more info:

Mikio Hara

unread,
May 20, 2014, 8:50:02 PM5/20/14
to satos...@gmail.com, golang-nuts
i haven't tried it but at least go1.2 supports ECDHE_RSA and
ECDHE_ECDSA; key exchanging w/ ephemeral ECDH with ECDSA or RSA
signatures. EDH is not supported (yet?), see golang.org/issue/7758.
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

satos...@gmail.com

unread,
May 20, 2014, 9:37:42 PM5/20/14
to golan...@googlegroups.com, satos...@gmail.com
I will try using tls.Dial and specify ECDHE_ECDSA in the config, completely replacing listenandserveTLS?

Jeff Hodges

unread,
May 21, 2014, 11:22:58 AM5/21/14
to golan...@googlegroups.com, satos...@gmail.com
If you are putting this over the public web, you leave the cipher suite config alone and just turn off session tickets. You get perfect forward secrecy by default when using Go's tls library if you disable or rotate session tickets[1]. The other cipher suites and TLS/SSL versions are there because the majority of users on the public web will not have client's capable of TLS 1.2 connections. (That's a real problem, unfortunately.)

If it's something private and you control the clients, you can definitely limit the config to one or more of the DHE cipher suites crypto/tls speaks (<http://golang.org/pkg/crypto/tls/#pkg-constants>) and disabling or rotating session tickets.

Caveat: I'm not sure that crypto/rsa has had all of its non-constant time operations removed yet. Someone else will have to speak to that.

Jeff Hodges

unread,
May 21, 2014, 11:23:40 AM5/21/14
to golan...@googlegroups.com, satos...@gmail.com
Also, really great that you're looking into this stuff! Thanks for helping make the web more secure.

Ask Satoshi

unread,
May 21, 2014, 12:53:50 PM5/21/14
to Jeff Hodges, golan...@googlegroups.com
I'm building (over half done) an open source social network / template secure web platform that favors privacy over scalability, I already built a central encrypted AJAX (post) API that uses RSA (server side decryption) with CryptoJS implemented with single use keys derived from user input entropy, and a cryptographic filesystem that mixes uniform chunks of encrypted data to offer un-attackable filesystem which can safely be made public for redundancy. No cookies are used either.

Looking for contributors that would benefit to have a turnkey template platform for making any HTML/JS/GO web app that has a focus on having critical security. I built the web app framework from scratch, choosing no active external storage so far, just loading mostly everything (including all resources for security) into RAM for speed and dumping backups to firebase every 300 seconds.

This project would have two uses: for people who want to go indie with their email and cloud / website hosting / social networks, and for web developers who want to bootstrap projects wordpress style but with a fraction of the code, but with way more useful features. Maybe a nice gui for windows noob installation/initial config. Coding should not be necessary on the user's behalf to choose which features they need and operate an instance with a default or available theme. It will soon have an internal admin suite to manage all aspects of it's deployment instance. It can host multiple domain names in parallel and host them from within the platform entirely.

At the moment its one big page of 7000 lines of go code for 'convenience' and so I de-bloat as I go.. I need help with basic project structure, good crypto practice, while less important is feature development. This one page downloads UI resources from webhost location of it's default theme and then it's good to go... Interface is simple but flexible.

So far there is:

https default
central fully encrypted AJAX system
Websockets IM
encrypted email (encrypted with the user's RSA key (priv key encrypted with their passphrase) when reaching the server)
website builder/hosting including css editor
blog editor
chatrooms
user profile
private messages
advertising
rss news reader
file hosting
encrypted file storage
forums

planned:

further attack surface reduction
blockchain explorer for arbitrary cryptocurrencies
fully end to end encrypted chat (RSA keygen in client browser)
ability to interface with other mail api than MailGun, or implement mail server

but the main feature is the abstraction of the various functions allowing rapid prototyping of complicated sites without ever having to worry about sanitization & transport security, whilst being OWASP compliant. Can call the framework GOWASP

satos...@gmail.com

unread,
May 21, 2014, 8:13:23 PM5/21/14
to golan...@googlegroups.com, Jeff Hodges, satos...@gmail.com
Reply all
Reply to author
Forward
0 new messages